[
https://issues.apache.org/jira/browse/GROOVY-11007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11007:
---------------------------------
Fix Version/s: 4.0.12
> STC: instanceof guard for property loses type information
> ---------------------------------------------------------
>
> Key: GROOVY-11007
> URL: https://issues.apache.org/jira/browse/GROOVY-11007
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 3.0.17, 4.0.11
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.12
>
>
> Consider the following:
> {code:groovy}
> interface I {
> CharSequence getCharSequence()
> }
> void accept(CharSequence cs) { }
> void test(I i) {
> i.with {
> if (charSequence instanceof String) {
> charSequence.toUpperCase()
> accept(charSequence)
> }
> }
> }
> test({ -> 'works' } as I)
> {code}
> Reports "Cannot find matching method script#accept(java.lang.Object)".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)