[ https://issues.apache.org/jira/browse/GROOVY-11720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18010159#comment-18010159 ]
ASF GitHub Bot commented on GROOVY-11720: ----------------------------------------- Copilot commented on code in PR #2273: URL: https://github.com/apache/groovy/pull/2273#discussion_r2233116167 ########## subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/dsl/GinqAstBuilder.java: ########## @@ -53,11 +53,13 @@ import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; Review Comment: [nitpick] The Collections import is only used for Collections.unmodifiableSet() calls. Consider using Set.of() if targeting Java 9+ for better readability and performance. ```suggestion ``` > [GINQ] Failed to recognize sub-query in where clause > ---------------------------------------------------- > > Key: GROOVY-11720 > URL: https://issues.apache.org/jira/browse/GROOVY-11720 > Project: Groovy > Issue Type: Bug > Affects Versions: 4.0.28, 5.0.0-beta-2 > Reporter: Daniel Sun > Assignee: Daniel Sun > Priority: Major > > {code:java} > assert [2] == GQ { > from n in [1, 2, 3] > where n == (from m in [1, 2] select max(m)) > select n > }.toList() > {code} > yields the following error: > {code:java} > groovy.lang.MissingPropertyException: No such property: m for class: > ConsoleScript2 > at > org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:69) > at > org.codehaus.groovy.vmplugin.v8.IndyGuardsFiltersAndSignatures.unwrap(IndyGuardsFiltersAndSignatures.java:163) > at > org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:344) > at ConsoleScript2$_run_closure1$_closure2.doCall(ConsoleScript2:3) > at > java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:580) > at > org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:338) > at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:274) > at > org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:270) > at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1008) > at groovy.lang.Closure.call(Closure.java:471) > at > org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:54) > at > org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:114) > at jdk.proxy1/jdk.proxy1.$Proxy27.test(Unknown Source) > at > java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178) > at > java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) > at > java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) > at > java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) > at > java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) > at > java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) > at > java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) > at > org.apache.groovy.ginq.provider.collection.runtime.QueryableCollection.toList(QueryableCollection.java:580) > at > org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:344) > at ConsoleScript2.run(ConsoleScript2:1) > at > groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:290) > at groovy.lang.GroovyShell.run(GroovyShell.java:422) > at groovy.lang.GroovyShell.run(GroovyShell.java:401) > at groovy.lang.GroovyShell.run(GroovyShell.java:201) > at groovy.console.ui.Console$GroovySourceType.run(Console.groovy:1189) > at groovy.console.ui.Console.doRun(Console.groovy:1421) > at > java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:580) > at > org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:338) > at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:274) > at > org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:318) > at > org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:344) > at > groovy.console.ui.Console$_runScriptImpl_closure23.doCall(Console.groovy:1379) > at > groovy.console.ui.Console$_runScriptImpl_closure23.doCall(Console.groovy) > at > java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:580) > at > org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:338) > at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:274) > at > org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:270) > at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1008) > at groovy.lang.Closure.call(Closure.java:471) > at groovy.lang.Closure.call(Closure.java:450) > at groovy.lang.Closure.run(Closure.java:543) > at java.base/java.lang.Thread.run(Thread.java:1583) > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)