Skip to content

unknown default value for stubs #951

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

Sometimes we want to mark a parameter in the stubs as optional, but don't know its exact default value or cannot express it in the language. Here, the exact default values are only provided for documentation anyway.

A possible solution is to make the type nullable and use null as the default value. This, however, also means that the library must accept null there. Moreover, it allows passing null explicitly, which is often not desired.

Desired solution

  • Add a new literal expression unknown.
  • Add a check that this must only be used as the default value of parameters of stubs declarations.
  • Compute its type as Nothing.
  • In the partial evaluator, it should lead to UnknownValue if it occurs in the computation.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions