Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"

This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
This commit is contained in:
Mikhail Zarechenskiy
2019-06-04 17:41:43 +03:00
parent f48640f91c
commit 787a8bb9bd
79 changed files with 197 additions and 887 deletions
@@ -29,9 +29,9 @@ class WithMod {
<!FORBIDDEN_BINARY_MOD!>operator<!> fun mod(other: WithMod) = this
fun test() {
val a = this <!OI;FORBIDDEN_BINARY_MOD_AS_REM!>%<!> this
val a = this <!OI;FORBIDDEN_BINARY_MOD_AS_REM!>%<!> <!NI;TYPE_MISMATCH!>this<!>
var b = this.mod(this)
<!NI;TYPE_MISMATCH!>b <!OI;FORBIDDEN_BINARY_MOD_AS_REM!>%=<!> this<!>
<!NI;TYPE_MISMATCH!>b <!OI;FORBIDDEN_BINARY_MOD_AS_REM!>%=<!> <!NI;TYPE_MISMATCH!>this<!><!>
}
}
@@ -43,6 +43,6 @@ fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a <!NI;DEBUG_INFO_UNRESOLVED_WITH_TARGET, NI;UNRESOLVED_REFERENCE!>%=<!> 3
1.mod(2)
b % s
1.0 % 2.0
b % <!NI;TYPE_MISMATCH!>s<!>
1.0 % <!NI;CONSTANT_EXPECTED_TYPE_MISMATCH!>2.0<!>
}
@@ -29,9 +29,9 @@ class WithMod {
<!DEPRECATED_BINARY_MOD!>operator<!> fun mod(other: WithMod) = this
fun test() {
val a = this <!OI;DEPRECATED_BINARY_MOD_AS_REM!>%<!> this
val a = this <!OI;DEPRECATED_BINARY_MOD_AS_REM!>%<!> <!NI;TYPE_MISMATCH!>this<!>
var b = this.mod(this)
<!NI;TYPE_MISMATCH!>b <!OI;DEPRECATED_BINARY_MOD_AS_REM!>%=<!> this<!>
<!NI;TYPE_MISMATCH!>b <!OI;DEPRECATED_BINARY_MOD_AS_REM!>%=<!> <!NI;TYPE_MISMATCH!>this<!><!>
}
}
@@ -43,6 +43,6 @@ fun builtIns(b: Byte, s: Short) {
var a = 1 % 2
a <!NI;DEBUG_INFO_UNRESOLVED_WITH_TARGET, NI;UNRESOLVED_REFERENCE!>%=<!> 3
1.mod(2)
b % s
1.0 % 2.0
b % <!NI;TYPE_MISMATCH!>s<!>
1.0 % <!NI;CONSTANT_EXPECTED_TYPE_MISMATCH!>2.0<!>
}