groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: About type inference of method return value
Date Fri, 07 Sep 2018 07:03:47 GMT
On 06.09.2018 20:51, MG wrote:
[..]
> The "int to long" inference example is an interesting special case that 
> I think would need to be discussed*: We could either reject these case 
> (throw CTE) - or maybe inferring to a higher up super type (Number in 
> the extreme case) could sort of work...
> But due to inherently involved performance/precision issues, in my 
> opinion inferring number types does not seem like a good idea...

I could have made the example differently and let it return a different 
"incompatible, but fitting" type. You should not get too hang up on the 
specific types in use, but look more at the secondary effects the change has

  bye Jochen


Mime
View raw message