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

a compiler error fired when add a Structural annotation to io.vertx.core.Handler #462

Closed jinwik closed 1 year ago

jinwik commented 1 year ago

Describe the bug a compiler error fired when make io.vertx.core.Handler to a structural interface

To Reproduce Steps to reproduce the behavior: `package extensions.io.vertx.core.Handler;

@Extension @Structural public class MyHandlerExtension { }`

Expected behavior

Screenshots

Desktop (please complete the following information):

Additional context As a custom extension library, it compiles normally, but when used as a dependency, the following error occurs:

Stack trace Please include a stack trace if applicable [INFO] Compiling 1 source file with javac [debug target 1.8] to target/classes An exception has occurred in the compiler (1.8.0_362). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you. com.sun.tools.javac.code.Types$FunctionDescriptorLookupError at com.sun.tools.javac.code.Types.<init>(Types.java:123) at manifold.internal.javac.ManTypes_8.<init>(ManTypes_8.java:73) at manifold.internal.javac.ManTypes_8.instance(ManTypes_8.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at manifold.util.ReflectUtil$MethodRef.invokeStatic(ReflectUtil.java:962) at manifold.internal.javac.JavacPlugin.tailorJavaCompiler(JavacPlugin.java:437) at manifold.internal.javac.JavacPlugin.initialize(JavacPlugin.java:1011) at manifold.internal.javac.JavacPlugin.started(JavacPlugin.java:1041) at com.sun.tools.javac.api.ClientCodeWrapper$WrappedTaskListener.started(ClientCodeWrapper.java:668) at com.sun.tools.javac.api.MultiTaskListener.started(MultiTaskListener.java:103) at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:978) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857) at com.sun.tools.javac.main.Main.compile(Main.java:523) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:136) at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:183) at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1140) at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:193) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) at org.apache.maven.cli.MavenCli.main(MavenCli.java:193) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) at org.codehaus.classworlds.Launcher.main(Launcher.java:47)

jinwik commented 1 year ago
image
rsmckinney commented 1 year ago

Hi @jinwik. In your example you have:

@extension
@Structural
public class MyHandlerExtension {
}

With extension should be Extension by importing manifold.ext.rt.api.Extension. Just want to make sure this is not just a typo.

jinwik commented 1 year ago

This is not a typo; it might be an issue with the GitHub editor. I will create a minimal reproduction scenario.

rsmckinney commented 1 year ago

@jinwik Is this still an issue for you?

jinwik commented 1 year ago

there is not an issue when upgraded to v2023.1.19

jinwik commented 1 year ago

@rsmckinney If such an error(An unknown compilation problem occurred) is found again, how to debug? thx

rsmckinney commented 1 year ago

If it happens again (let's hope not) your best bet is to report the issue here. Debugging this type of problem involves debugging the javac compiler, which steps into and out of manifold code and understanding how it may have manifested. It can get a bit gnarly. Not suggesting you lack the chops, just saying it's probably best if you just throw it over the wall to me.