Kotlin / kotlin-spec

Kotlin Language Specification:
https://kotlinlang.org/spec
Apache License 2.0
387 stars 80 forks source link

Improve description of callable references to top-level entities and to constructors #111

Open FenstonSingel opened 2 years ago

FenstonSingel commented 2 years ago

As of now, section 8.21 "Call and property access expressions" — and subsection 8.21.2 "Callable references" specifically — both imply that left-hand-side argument of the reference operator :: can only be either a type name or an existing value. This phrasing excludes callable references to top-level entities (e.g. ::foo) and to constructors (e.g. ::Klass) which have no LHS arguments. Moreover, callable references to constructors have type names as right-hand-side arguments, the fact of which also requires additional coverage.