groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel.Sun" <sun...@apache.org>
Subject Re: About type inference of method return value
Date Wed, 05 Sep 2018 11:36:01 GMT
Hi C├ędric,

 > Basically, it's not easy to realize that when you have a non final
methods, subclasses can override the method to return a different type.

     As I proposed, the methods with smarter return type inference should
match one of the following charactristics: 
1) `final` 
2) `private` 
3) `static` 
4)  method defined in Script

     So these methods will not be overrided and the return type will be
exact.

     I will leave the implementation as it is util most of groovy users
require the smarter type inference ;-)

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

Mime
View raw message