[
https://issues.apache.org/jira/browse/GROOVY-11356?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-11356:
---------------------------------
Description:
Follow up from GROOVY-11319. One case that was left unhandled is the
implicit-this case. Consider the following:
{code:groovy}
abstract class A {
private int x // or "private int getX() {}"
}
class C extends A {
@TypeChecked m() {
super.x // "No such property: x" error
this.x // "No such property: x" error
x // MissingPropertyException at runtime
this.with {
thisObject.x // "No such property: x" error
delegate.x // "No such property: x" error
owner.x // "No such property: x" error
this.x // "No such property: x" error
it.x // "No such property: x" error
x // MissingPropertyException at runtime
}
}
}
{code}
was:
Follow up from GROOVY-11319. One case that was left unhandled is the
implicit-this case. Consider the following:
{code:groovy}
abstract class A {
private int x
}
class C extends A {
@TypeChecked m() {
super.x // "No such property: x" error
this.x // "No such property: x" error
x // MissingPropertyException at runtime
this.with {
thisObject.x // "No such property: x" error
delegate.x // "No such property: x" error
owner.x // "No such property: x" error
this.x // "No such property: x" error
it.x // "No such property: x" error
x // MissingPropertyException at runtime
}
}
}
{code}
> STC: missing property error for implicit-this reference to private super field
> ------------------------------------------------------------------------------
>
> Key: GROOVY-11356
> URL: https://issues.apache.org/jira/browse/GROOVY-11356
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> Follow up from GROOVY-11319. One case that was left unhandled is the
> implicit-this case. Consider the following:
> {code:groovy}
> abstract class A {
> private int x // or "private int getX() {}"
> }
> class C extends A {
> @TypeChecked m() {
> super.x // "No such property: x" error
> this.x // "No such property: x" error
> x // MissingPropertyException at runtime
> this.with {
> thisObject.x // "No such property: x" error
> delegate.x // "No such property: x" error
> owner.x // "No such property: x" error
> this.x // "No such property: x" error
> it.x // "No such property: x" error
> x // MissingPropertyException at runtime
> }
> }
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)