Eric Milles created GROOVY-11007:
------------------------------------
Summary: 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
Reporter: Eric Milles
Assignee: Eric Milles
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)