Skip to content

Validation error: Impure function calls parameter with unknown purity #732

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

Consider this function:

@Impure(allReasons=[
    FileReadFromConstantPath("test.txt")
])
fun f(g: () -> ())

Here, g also accepts impure callables. However, the impurity reason PotentiallyImpureParameterCall("g") is missing. Either the impurity reason must be added or g must be made @Pure.

Vice versa, a parameter should not be marked as @Pure and be included as PotentiallyImpureParameterCall.

Desired solution

Show an appropriate error in this case.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a releasevalidation ✔️Improved or new static checks

Type

No type

Projects

Status

✔️ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions