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 @@ -2515,17 +2515,19 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2515
2515
}
2516
2516
2517
2517
def typedAppliedTypeTree (tree : untpd.AppliedTypeTree )(using Context ): Tree = {
2518
+ val tpt1 = withoutMode(Mode .Pattern ):
2519
+ typed(tree.tpt, AnyTypeConstructorProto )
2520
+
2518
2521
tree.args match
2519
2522
case arg :: _ if arg.isTerm =>
2520
2523
if Feature .dependentEnabled then
2521
- return errorTree(tree, em " Not yet implemented: T(...) " )
2524
+ tpt1.tpe.typeSymbol.primaryConstructor.typeRef.underlying match
2525
+ case mt : MethodType =>
2526
+ return TypeTree (mt.instantiate(tree.args.map((typedExpr(_).tpe))))
2522
2527
else
2523
2528
return errorTree(tree, dependentMsg)
2524
2529
case _ =>
2525
-
2526
- val tpt1 = withoutMode(Mode .Pattern ) {
2527
- typed(tree.tpt, AnyTypeConstructorProto )
2528
- }
2530
+
2529
2531
val tparams = tpt1.tpe.typeParams
2530
2532
if tpt1.tpe.isError then
2531
2533
val args1 = tree.args.mapconserve(typedType(_))
You can’t perform that action at this time.
0 commit comments