Closed scabug closed 13 years ago
Imported From: https://issues.scala-lang.org/browse/SI-372?orig=1 Reporter: prr
@dragos said: I'd say this has to do with the 'longest match' rule for the lexer, so I vote for a 'feature', but I find it a bit strange that the same doesn't happen for 'toString'.
Geoffrey Alan Washburn (washburn) said: Indeed
scala> 1.toString
res0: java.lang.String = 1
scala> (1.0).toString
res1: java.lang.String = 1.0
I am not sure why being followed by letters rather than symbols should affect how many glyphs are matched as part of the number.
@odersky said: There's a special rule in the Scanner to treat fractions. I have updated the spec to reflect this:
If a floating point literal in a program is followed by a token starting with a letter, there must be at least one intervening whitespace character between the two tokens.
@odersky said: Milestone 2.7.0 deleted
Scala 2.6.1 final[[BR]] Hope this is the right place to fill a possible bug[[BR]]
I'm just starting with scala, but my understanding is that
a->b
is compiled intoa.->(b)
, so the two expressions would give the same result. But in my test results are different, probably because scala is considering the dot as decimal separator and not as operator.Feature or bug?