-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Motif should handle presence of ErrorType gracefully #51
Comments
This should also help increase the robustness of motif compiler when running with other APs that generate new Types. e.g. providing an annotation processor generated type through DI |
Agree that we should handle error types better. The annotation processing order should already be handled by BasicAnnotationProcess (with some caveats). |
One more case of an exception with ErrorTypes in 0.1.0
Fails with | java.lang.IllegalArgumentException: not a valid name: |
|
When running motif in incremental compilation build setting the motif compiler tends to crash out frequently whenever it encounters an ErrorType.
Instead motif should defer parsing structures that contain error types and let javac report them during its normal compilation.
0.0.13:
Repro steps or stacktrace:
+--------------------------------------------------------------------------------------------------+
This was from having an ErrorType as a parameter to a basic factory method.
Have encountered other in other spots of the compiler when an error type is the return type of a factory method et.al.
| |
| The annotation processor motif.compiler.Processor has crashed. |
| |
| This is likely a bug in the annotation processor itself, though there may be changes you can |
| make to your code to work around it. Examine the exception stack trace below and consult the |
| annotation processor's troubleshooting guide. |
| |
| javax.lang.model.element.UnknownElementException: Unknown element: |
| at javax.lang.model.util.AbstractElementVisitor6.visitUnknown(AbstractElementVisitor6.java:129) |
| at com.sun.tools.javac.code.Symtab$6.accept(Symtab.java:410) |
| at motif.compiler.codegen.NameVisitor.visitDeclared(Names.kt:57) |
| at motif.compiler.codegen.NameVisitor.visitError(Names.kt:82) |
| at motif.compiler.codegen.NameVisitor.visitError(Names.kt:39) |
| at com.sun.tools.javac.code.Type$ErrorType.accept(Type.java:2383) |
| at javax.lang.model.util.AbstractTypeVisitor6.visit(AbstractTypeVisitor6.java:105) |
| at motif.compiler.codegen.Names$Companion.safeName(Names.kt:30) |
| at motif.compiler.codegen.JavaPoetUtil$NameScope.name(JavaPoetUtil.kt:166) |
| at motif.compiler.codegen.JavaPoetUtil$NameScope.methodSpecBuilder(JavaPoetUtil.kt:150) |
| at motif.compiler.codegen.JavaPoetUtil$methodSpecBuilders$1.invoke(JavaPoetUtil.kt:128) |
| at motif.compiler.codegen.JavaPoetUtil$methodSpecBuilders$1.invoke(JavaPoetUtil.kt:39) |
| at motif.compiler.codegen.JavaPoetUtil$DefaultImpls.nameScope(JavaPoetUtil.kt:142) |
| at motif.compiler.codegen.CodegenCache.nameScope(CodegenCache.kt:32) |
| at motif.compiler.codegen.JavaPoetUtil$DefaultImpls.methodSpecBuilders(JavaPoetUtil.kt:127) |
| at motif.compiler.codegen.CodegenCache.methodSpecBuilders(CodegenCache.kt:32) |
| at motif.compiler.codegen.ScopeImplFactory.dependencies(ScopeImplFactory.kt:93) |
| at motif.compiler.codegen.ScopeImplFactory.create(ScopeImplFactory.kt:50) |
| at motif.compiler.codegen.Generator.generate(Generator.kt:34) |
| at motif.compiler.Processor.process(Processor.kt:63) |
| at motif.compiler.Processor.process(Processor.kt:50) |
| |
+--------------------------------------------------------------------------------------------------+
The text was updated successfully, but these errors were encountered: