Skip to content

Conversation

@Junio00r
Copy link

@Junio00r Junio00r commented Dec 5, 2025

Add specification about ill-defined or undefined value in the semantic of the formal language (Kotlin)

Add specification about "ill-defined" or "undefined" value in the semantic of the formal language (Kotlin)
* Nothing has no instances. You can use Nothing to represent "a value that never exists": for example,
* if a function has the return type of Nothing, it means that it never returns (always throws an exception).
* Nothing has no instances. You can use Nothing to represent semantically an "undefined value" or "a value that never exists": for example,
* if a function has the return type of Nothing, it means that it never returns a value accept by the Kotlin (always throws an exception).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's incorrect: such functions are indeed never return normally (in control-flow sense).

/**
* Nothing has no instances. You can use Nothing to represent "a value that never exists": for example,
* if a function has the return type of Nothing, it means that it never returns (always throws an exception).
* Nothing has no instances. You can use Nothing to represent semantically an "undefined value" or "a value that never exists": for example,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please provide an example of how Nothing could be used to represent an undefined value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants