groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamie Echlin <jamie.ech...@gmail.com>
Subject infer return type of script
Date Mon, 21 Sep 2015 20:34:57 GMT
Hi...

Is it possible to infer the return type, or types of a script during static
compilation? Presumably there is always a finite list of branches where the
script could end.

I'm looking
at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor#getInferredReturnType,
but I'm not really sure how to call it from a type checking script, nor
what adds the inferred return type to the metadata which is used in that
method.

cheers, jamie

Mime
View raw message