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 =>
1394
1394
}
1395
1395
1396
1396
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))
1400
1398
1401
1399
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))
1405
1401
1406
1402
def typedAheadAnnotation (tree : Tree )(using Context ): tpd.Tree =
1407
1403
typedAheadExpr(tree, defn.AnnotationClass .typeRef)
Original file line number Diff line number Diff line change @@ -2959,7 +2959,7 @@ class Typer extends Namer
2959
2959
def typedExpr (tree : untpd.Tree , pt : Type = WildcardType )(using Context ): Tree =
2960
2960
withoutMode(Mode .PatternOrTypeBits )(typed(tree, pt))
2961
2961
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) }
2963
2963
def typedPattern (tree : untpd.Tree , selType : Type = WildcardType )(using Context ): Tree =
2964
2964
withMode(Mode .Pattern )(typed(tree, selType))
2965
2965
You can’t perform that action at this time.
0 commit comments