dart-lang / dart-lang/language

Should we provide a dynamically checked function type?

Open
#295 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

**Edited** Editing this to re-point this to the more general problem of having a type for dynamically checked functions, without being specific as to the mechanism (using `Never` as the marker being one particular strategy).

The type `int Function(Never)` is useful only as a top type for unary functions. It could be useful to allow calls to this to be done using dynamic runtime checks, since in practice all deliberate uses of such function types currently require going through a dynamic call.

A concern is the possibility of inadvertent uses - are there scenarios this might arise accidentally through inference?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.