Kotlin / kotlin-spec

Kotlin Language Specification:

Home Page:https://kotlinlang.org/spec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Define which scope function parameters are in

belyaev-mikhail opened this issue · comments

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.