Skip to content

Commit b4a0d3f

Browse files
committed
TreeChecker: allow _ in patterns to be typed as selection
Needed to get tests/pos/infersingle.scala to pass -Ycheck:frontend
1 parent 3b574ea commit b4a0d3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class TreeChecker extends Phase with SymTransformer {
308308

309309
override def typedIdent(tree: untpd.Ident, pt: Type)(implicit ctx: Context): Tree = {
310310
assert(tree.isTerm || !ctx.isAfterTyper, tree.show + " at " + ctx.phase)
311-
assert(tree.isType || !needsSelect(tree.tpe), i"bad type ${tree.tpe} for $tree # ${tree.uniqueId}")
311+
assert(tree.isType || ctx.mode.is(Mode.Pattern) && untpd.isWildcardArg(tree) || !needsSelect(tree.tpe), i"bad type ${tree.tpe} for $tree # ${tree.uniqueId}")
312312
assertDefined(tree)
313313

314314
checkNotRepeated(super.typedIdent(tree, pt))

0 commit comments

Comments
 (0)