[
https://issues.apache.org/jira/browse/GROOVY-11372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17844992#comment-17844992
]
Eric Milles commented on GROOVY-11372:
--------------------------------------
The read-only property designation is also not provided, since setter(s) are
not inspected.
> STC: write property via extension method
> ----------------------------------------
>
> Key: GROOVY-11372
> URL: https://issues.apache.org/jira/browse/GROOVY-11372
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 3.0.21, 5.0.0-alpha-8, 4.0.21
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test(OutputStream os) {
> os.bytes = new byte[0]
> }
> {code}
> Compiler reports "No such property: bytes for class: java.io.OutputStream".
> This is because {{StaticTypeCheckingVisitor#existsProperty}} looks for
> isser/getter to determine property type. This only works for matched methods
> like "MetaClass getMetaClass()" and "void setMetaClass(MetaClass mc)".
> GROOVY-9115, GROOVY-9123, GROOVY-11370
--
This message was sent by Atlassian Jira
(v8.20.10#820010)