Improve type parameter treatment.

This commit is contained in:
Juraj Kirchheim
2018-10-01 16:10:45 +02:00
parent e398d0e694
commit 4f84570bb7

View File

@@ -70,7 +70,16 @@ class Sisyphus {
case TInst(_.get() => classType, params):
switch (classType.kind) {
case KTypeParameter(_):
direct();//TODO: check if the parameter is in scope, in which case the name can simply be used
var ct = Types.asComplexType(classType.name);
switch Types.toType(ct) {
case Success(TInst(_.get() => cl, _)) if (
cl.kind.match(KTypeParameter(_))
&& cl.module == classType.module
&& cl.pack.join('.') == classType.pack.join('.')
): ct;
default:
direct();
}
default:
TPath(toTypePath(classType, params));
}