manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.43k stars 125 forks source link

[Bug] compiler error when using tuples directly as method parameters #488

Closed CC007 closed 1 year ago

CC007 commented 1 year ago

Describe the bug I get an error when using a tuple as a method parameter (see stacktrace).

To Reproduce Steps to reproduce the behavior:

Expected behavior I expect the tuple to work as a method parameter just like a tuple variable works or as a tuple works in a [ ] notation.

Desktop (please complete the following information):

Stack trace

java: An exception has occurred in the compiler (20.0.2). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java: java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.hasTag(com.sun.tools.javac.code.TypeTag)" because "found" is null
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1072)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr$ResolvedMemberType.overloadCheck(ArgumentAttr.java:645)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr$ArgumentType.complete(ArgumentAttr.java:356)
java:   at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:359)
java:   at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:343)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.checkSpeculative(ArgumentAttr.java:158)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.checkSpeculative(ArgumentAttr.java:149)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr$ParensType.overloadCheck(ArgumentAttr.java:414)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1074)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:901)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:789)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:910)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:632)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1585)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1791)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1862)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1835)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve$12.doLookup(Resolve.java:2764)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3479)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3731)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2761)
java:   at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2755)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.selectSym(Attr.java:4515)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:4391)
java:   at manifold.internal.javac.ManAttr_17.visitSelect(ManAttr_17.java:143)
java:   at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2547)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:663)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2591)
java:   at manifold.internal.javac.ManAttr_17.visitApply(ManAttr_17.java:564)
java:   at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1817)
java:   at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:500)
java:   at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:480)
java:   at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:467)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.lambda$processArg$0(ArgumentAttr.java:220)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.processArg(ArgumentAttr.java:242)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.processArg(ArgumentAttr.java:219)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.visitApply(ArgumentAttr.java:313)
java:   at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.attribArg(ArgumentAttr.java:197)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:661)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:764)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2582)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:716)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.visitExec(Attr.java:2300)
java:   at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1604)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:737)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:756)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1440)
java:   at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1088)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1230)
java:   at manifold.internal.javac.ManAttr_17.visitMethodDef(ManAttr_17.java:214)
java:   at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:912)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5592)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5485)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5309)
java:   at manifold.internal.javac.ManAttr_17.attribClass(ManAttr_17.java:1169)
java:   at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:5248)
java:   at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1331)
java:   at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:960)
java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104)
java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.invocationHelper(JavacTaskImpl.java:152)
java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100)
java:   at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94)
java:   at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:239)
java:   at org.jetbrains.jps.incremental.java.JavaBuilder.lambda$compileJava$2(JavaBuilder.java:524)
java:   at org.jetbrains.jps.incremental.java.JavaBuilder.invokeJavac(JavaBuilder.java:587)
java:   at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:522)
java:   at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:366)
java:   at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:291)
java:   at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:245)
java:   at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1553)
java:   at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1183)
java:   at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1333)
java:   at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1148)
java:   at org.jetbrains.jps.incremental.IncProjectBuilder$BuildParallelizer$1.run(IncProjectBuilder.java:1114)
java:   at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:248)
java:   at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:28)
java:   at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:221)
java:   at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:227)
java:   at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210)
java:   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
java:   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
java:   at java.base/java.lang.Thread.run(Thread.java:1623)
java: Compilation failed: internal java compiler error
rsmckinney commented 1 year ago

Fix available with release 2023.1.24

CC007 commented 1 year ago

Verified fixed