Infer type arguments of type alias constructors.
This commit is contained in:
+8
@@ -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("")
|
||||
+3
@@ -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
|
||||
Reference in New Issue
Block a user