[SI-8456] Use of numbers in backquoted identifiers results in unintelligible repl errors Created: 28/Mar/14  Updated: 11/Sep/15

Status: Open
Project: Scala Programming Language
Component/s: Repl / Interpreter
Affects Version/s: Scala 2.11.0-RC4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Denys Shabalin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by SI-9467 REPL does not compile for ident name `1` CLOSED

 Description   

scala> val `1 + 1` = 1 + 1
<console>:5: error: Invalid literal number
  lazy val $result = 1$u0020$plus$u00201
                                                                         ^
<console>:10: error: Invalid literal number
 + "1 + 1: Int = " + scala.runtime.ScalaRunTime.replStringOf(1$u0020$plus$u00201, 1000)
                                                                                                                 ^
<console>:13: error: ')' expected but '}' found.
  }
  ^



 Comments   
Comment by Denys Shabalin [ 28/Mar/14 ]

This issues seems to be localized to the REPL. It works just fine if you put into a regular file and compile it.

Comment by Li Haoyi [ 19/Apr/15 ]

This has been fixed in the Ammonite REPL.

@  val `1 + 1` = 1 + 1
`1 + 1`: Int = 2
@ `1 + 1`
res31: Int = 2
@

Generated at Tue Jun 19 03:14:32 CEST 2018 using JIRA 7.9.1#79001-sha1:60970b42586a2ec2760ed6cfe825b26961e62b9e.