Permalink
Browse files

Revert "SI-6426, importable _."

This reverts commit d2316df.

We can't make `_` an illegal identifier -- it's legal in Java,
so we must be able to name these Java underscores.
  • Loading branch information...
adriaanm committed Dec 10, 2013
1 parent 9cdbe28 commit 47562e7adbf8577789b3432f4bfbb36d786c6b32
@@ -980,8 +980,11 @@ self =>
/** Assumed (provisionally) to be TermNames. */
def ident(skipIt: Boolean): Name =
- if (isIdent) rawIdent().encode
- else {
+ if (isIdent) {
+ val name = in.name.encode
+ in.nextToken()
+ name
+ } else {
syntaxErrorOrIncomplete(expectedMsg(IDENTIFIER), skipIt)
nme.ERROR
}
@@ -611,10 +611,7 @@ trait Scanners extends ScannersCommon {
if (ch == '`') {
nextChar()
finishNamed(BACKQUOTED_IDENT)
- if (name.length == 0)
- syntaxError("empty quoted identifier")
- else if (name == nme.WILDCARD)
- syntaxError("wildcard invalid as backquoted identifier")
+ if (name.length == 0) syntaxError("empty quoted identifier")
}
else syntaxError("unclosed quoted identifier")
}
@@ -1,7 +0,0 @@
-t6426.scala:4: error: wildcard invalid as backquoted identifier
- println(`_`.Buffer(0))
- ^
-t6426.scala:5: error: ')' expected but '}' found.
-}
-^
-two errors found
@@ -1,5 +0,0 @@
-class A {
- import collection.{mutable => _, _}
-
- println(`_`.Buffer(0))
-}

0 comments on commit 47562e7

Please sign in to comment.