timowest / scalagen

Java to Scala transformation
Apache License 2.0
216 stars 32 forks source link

Double primitive ends up as int #56

Closed dnadolny closed 10 years ago

dnadolny commented 11 years ago

The Java double d = 3; converts to val d = 3, which is incorrect since the inferred type in Scala will be an Int, but it should be a Double. There needs to be an explicit type annotation, or it needs to be suffixed with d (val d = 3d), at least when there is no decimal point to make the inferred type correct.