Allow inferring property type from its getter
#KT-550 Fixed
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// !CHECK_TYPE
|
||||
var x
|
||||
get() = 1
|
||||
set(q) {
|
||||
q checkType { _<Int>() }
|
||||
}
|
||||
|
||||
<!MUST_BE_INITIALIZED!>var noSetter<!>
|
||||
get() = 1
|
||||
|
||||
|
||||
fun foo() {
|
||||
x checkType { _<Int>() }
|
||||
noSetter checkType { _<Int>() }
|
||||
|
||||
x = 1
|
||||
x = <!TYPE_MISMATCH!>""<!>
|
||||
|
||||
noSetter = 2
|
||||
noSetter = <!TYPE_MISMATCH!>""<!>
|
||||
}
|
||||
Reference in New Issue
Block a user