File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2557,17 +2557,19 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2557
2557
}
2558
2558
2559
2559
def typedAppliedTypeTree (tree : untpd.AppliedTypeTree )(using Context ): Tree = {
2560
+ val tpt1 = withoutMode(Mode .Pattern ):
2561
+ typed(tree.tpt, AnyTypeConstructorProto )
2562
+
2560
2563
tree.args match
2561
2564
case arg :: _ if arg.isTerm =>
2562
2565
if Feature .dependentEnabled then
2563
- return errorTree(tree, em " Not yet implemented: T(...) " )
2566
+ tpt1.tpe.typeSymbol.primaryConstructor.typeRef.underlying match
2567
+ case mt : MethodType =>
2568
+ return TypeTree (mt.instantiate(tree.args.map((typedExpr(_).tpe))))
2564
2569
else
2565
2570
return errorTree(tree, dependentMsg)
2566
2571
case _ =>
2567
-
2568
- val tpt1 = withoutMode(Mode .Pattern ) {
2569
- typed(tree.tpt, AnyTypeConstructorProto )
2570
- }
2572
+
2571
2573
val tparams = tpt1.tpe.typeParams
2572
2574
if tpt1.tpe.isError then
2573
2575
val args1 = tree.args.mapconserve(typedType(_))
You can’t perform that action at this time.
0 commit comments