[
https://issues.apache.org/jira/browse/GROOVY-12293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107604#comment-18107604
]
Paul King commented on GROOVY-12293:
------------------------------------
I noticed that for the vararg "use" variant, we don't fail with the normal
error message but then fail with "No such method/property" errors instead of
the category error. So I created GROOVY-12294 for that case to make it
consistent for now. If we do eventually support something here, we'd need to
fix all variants.
> STC with category classes or at least consistent error
> ------------------------------------------------------
>
> Key: GROOVY-12293
> URL: https://issues.apache.org/jira/browse/GROOVY-12293
> Project: Groovy
> Issue Type: Improvement
> Reporter: Björn Kautler
> Priority: Major
>
> If you use a category like `use(...) { ... }` the STC throws a compile error,
> that usage of categories is not possible with STC due to their dynamic nature.
> It would be nice if this limitation could be lifted. Why can't the category
> method not be resolved like other methods and under static compilation used
> directly?
> I probably miss something why this is not possible, but maybe then at least a
> consistent error could somehow be issued. If I have a Spock specification
> under STC (there is a PR to make this possible and I ported it to an AST
> transform that also makes it possible) and there have a `@Use(...)`
> annotation, then the compile error just says that the method is not found
> while expectation was that it was resolved from the category.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)