I agree with Daniel here, I also don't see how this could be confusing (?).
Even if the inference mechanism falls back to inferring Object, the user will 
just get an "cannot call dadadam on Object" or such compile error - which 
should immediately leave to the conclusion that the type needs to be given 
explicitely in this case...
Does anyone have an example that shows such a malign/confusing type deduction 
case ?

-------- Ursprüngliche Nachricht --------Von: "Daniel.Sun" <sun...@apache.org> 
Datum: 05.09.18  14:02  (GMT+01:00) An: d...@groovy.incubator.apache.org 
Betreff: Re: About type inference of method return value 
I just propose the smarter type inference for methods, which was in my TODO
list.

> We explicitly chose not to be too smart here, because it can be confusing
> to users.

OK. Recently I am developing a project based on Groovy.  Writing code with
"dynamic" mind and compile code in "static" way. So I don't care why STC
passes but just care why STC doesn't work and try to fix compilation errors,
some of which impress me that Groovy is not smart enough.
So I don't understand why smarter type inference will confuse users.

Cheers,
Daniel.Sun


Cheers,
Daniel.Sun




-----
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Reply via email to