Allow inferring property type from its getter

#KT-550 Fixed
This commit is contained in:
Denis Zharkov
2016-11-14 14:17:39 +03:00
parent 51a5bf9f7e
commit 6fca46a452
32 changed files with 460 additions and 38 deletions
@@ -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!>""<!>
}