File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1394,14 +1394,10 @@ class Namer { typer: Typer =>
13941394 }
13951395
13961396 def typedAheadType (tree : Tree , pt : Type = WildcardType )(using Context ): tpd.Tree =
1397- inMode(ctx.mode &~ Mode .PatternOrTypeBits | Mode .Type ) {
1398- typedAhead(tree, typer.typed(_, pt))
1399- }
1397+ typedAhead(tree, typer.typedType(_, pt))
14001398
14011399 def typedAheadExpr (tree : Tree , pt : Type = WildcardType )(using Context ): tpd.Tree =
1402- withoutMode(Mode .PatternOrTypeBits ) {
1403- typedAhead(tree, typer.typed(_, pt))
1404- }
1400+ typedAhead(tree, typer.typedExpr(_, pt))
14051401
14061402 def typedAheadAnnotation (tree : Tree )(using Context ): tpd.Tree =
14071403 typedAheadExpr(tree, defn.AnnotationClass .typeRef)
Original file line number Diff line number Diff line change @@ -2959,7 +2959,7 @@ class Typer extends Namer
29592959 def typedExpr (tree : untpd.Tree , pt : Type = WildcardType )(using Context ): Tree =
29602960 withoutMode(Mode .PatternOrTypeBits )(typed(tree, pt))
29612961 def typedType (tree : untpd.Tree , pt : Type = WildcardType )(using Context ): Tree = // todo: retract mode between Type and Pattern?
2962- withMode(Mode .Type )( typed(tree, pt))
2962+ withMode(Mode .Type ) { typed(tree, pt) }
29632963 def typedPattern (tree : untpd.Tree , selType : Type = WildcardType )(using Context ): Tree =
29642964 withMode(Mode .Pattern )(typed(tree, selType))
29652965
You can’t perform that action at this time.
0 commit comments