Skip to content

Global variable is not concretized #464

@ufechner7

Description

@ufechner7

To reproduce:

git clone https://github.com/ufechner7/FLORIDyn.jl
cd FLORIDyn.jl

and open the file examples/mpc_162.jl.

I get lots of errors like this one:

`MAX_STEPS` is not concretized but JET needs to use its actual value in order to define types or methods.
- If this binding can be declared as a constant, try to declare it as a constant (i.e. `const MAX_STEPS = ...`).
- You may need to specify `:(MAX_STEPS = x_)` pattern to the `concretization_patterns`
  configuration to allow JET to actually evaluate this binding, e.g.,
  `report_file("path/to/file.jl"; concretization_patterns = [:(MAX_STEPS = x_)])`.
- If the above approaches do not work, try `concretization_patterns = [:(x_)]` to
  concretize all top-level code in the module (recommended as a last resort since it
  would incur any side effects in your code and may cause the analysis to take longer time).

I can get rid of this if I define MAX_STEPS as constant, but that is not always possible.

There is a second suggestion in the warning, but I cannot see how to follow it when using JETLS. My impression is, that the text of this warning refers to people who use JET.jl directly and not JETLS.jl.

Is there a way to specify a concretization pattern for JETLS.jl, for example in .JETLSConfig.toml ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions