FIR: Consider abbreviation's nullability when expanding types

This commit is contained in:
Denis Zharkov
2020-02-10 16:43:42 +03:00
parent 2bb6e4fd97
commit 003aea2e68
7 changed files with 49 additions and 8 deletions
@@ -13,8 +13,8 @@ public class Throwables() {
}
}
public fun propagateIfPossible(throwable : Throwable?) : Unit {
<!INAPPLICABLE_CANDIDATE!>propagateIfInstanceOf<!>(throwable, getJavaClass<Error?>()) // Type inference failed: Mismatch while expanding constraints
<!INAPPLICABLE_CANDIDATE!>propagateIfInstanceOf<!>(throwable, getJavaClass<RuntimeException?>()) // Type inference failed: Mismatch while expanding constraints
propagateIfInstanceOf(throwable, getJavaClass<Error?>()) // Type inference failed: Mismatch while expanding constraints
propagateIfInstanceOf(throwable, getJavaClass<RuntimeException?>()) // Type inference failed: Mismatch while expanding constraints
}
}
}
}
@@ -10,8 +10,8 @@ public class Throwables() {
}
}
public fun propagateIfPossible(throwable : Throwable?) {
<!INAPPLICABLE_CANDIDATE!>propagateIfInstanceOf<!>(throwable, getJavaClass<Error?>()) //; Type inference failed: Mismatch while expanding constraints
<!INAPPLICABLE_CANDIDATE!>propagateIfInstanceOf<!>(throwable, getJavaClass<RuntimeException?>()) // Type inference failed: Mismatch while expanding constraints
propagateIfInstanceOf(throwable, getJavaClass<Error?>()) //; Type inference failed: Mismatch while expanding constraints
propagateIfInstanceOf(throwable, getJavaClass<RuntimeException?>()) // Type inference failed: Mismatch while expanding constraints
}
}
}
}
@@ -9,4 +9,4 @@ val ms: MyString = "MyString"
val msn: MyString? = null
val msc: MyStringContainer = Container(ms)
val msc1 = <!INAPPLICABLE_CANDIDATE!>MyStringContainer<!>(null)
val msc1 = MyStringContainer(null)