Skip to content

Commit

Permalink
TreeChecker: allow _ in patterns to be typed as selection
Browse files Browse the repository at this point in the history
Needed to get tests/pos/infersingle.scala to pass -Ycheck:frontend
  • Loading branch information
smarter committed Apr 17, 2018
1 parent aa5ece3 commit 5ac290f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/TreeChecker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class TreeChecker extends Phase with SymTransformer {

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

checkNotRepeated(super.typedIdent(tree, pt))
Expand Down

0 comments on commit 5ac290f

Please sign in to comment.