Skip to content

Semantic error: Function pointer #565

Closed
@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

To provide a clean graphical view, we should prohibit function pointers, like in

fun f()

fun g(p: () -> ())

// ...

g(f)

Desired solution

Add a validation check for this. Code that has this error might also have an alias error (#564), e.g.

fun f()

// ...

val a = f;

We need to decide whether to show both errors or only one of them.

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions