Kotlin / kotlin-spec

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

Define which scope function parameters are in #94

Open belyaev-mikhail opened 3 years ago

belyaev-mikhail commented 3 years ago

https://youtrack.jetbrains.com/issue/KT-28932#focus=Comments-27-5169515.0-0

Function parameters are a little bit weird: they're obviously in the scope of a function, but their defaults a little bit different to the scope of the function, and you can use local variables which shadow them (which is explicitly written as impossible for decls in the same scope in spec).

Also: primary constructor parameters, they're even weirder.