Infer type arguments of type alias constructors.

This commit is contained in:
Dmitry Petrov
2016-11-08 15:38:03 +03:00
parent 9b55ad82a0
commit 03d8aa272b
14 changed files with 265 additions and 18 deletions
@@ -0,0 +1,8 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: TYPE_INFERENCE_UPPER_BOUND_VIOLATED
// !MESSAGE_TYPE: TEXT
class Num<Tn : Number>(val x: Tn)
typealias N<T> = Num<T>
val test = N("")
@@ -0,0 +1,3 @@
<!-- upperBoundViolatedInTypeAliasConstructorCall1 -->
Type parameter bound for Tn in type inferred from type alias expansion for fun <T> <init>(x: T): Num<T>
is not satisfied: inferred type T is not a subtype of Number