Um - no,  I said:

m1 : STC error - giving a floating point literal when an integer is expected could point towards an error, and there is no inconvenience in writing 1 instead of 1.0 .

so both should not work.

On 26/11/2019 08:27, Jochen Theodorou wrote:
On 25.11.19 14:21, MG wrote:
Are we discussing different things here ? I understood the question to
be about number literals  ("GROOVY-8488: STC: floating-point _literals_
no longer accepted as args to method with double parameter"), not
variables of number type.
I am only arguing for literals to be conveniently groovy, not to have
dangerous autoconversions of e.g. BigDecimal -> Double...

So you suggest that in

def m(int i) {}

m(1.0) works, but

double x = 1.0
m(x)

does not, when statically compiled? Hmm... Groovy would be the first
programming language I know that does something like that. Not even
dynamic Groovy does allow that. Or did I misunderstand you?

bye Jochen


Reply via email to