-
Notifications
You must be signed in to change notification settings - Fork 193
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
Groovy compiler error: exception in phase 'class generation' in source unit #771
Comments
@boris-petrov You'll need to provide more information to understand this error. Is it possible to provide the project that you are trying to compile? Can you reduce the project to a minimal number of files that still exhibit the problem? |
@eric-milles - thanks for the response. I cannot provide the project but I will try to reproduce it in a minimal example. This will happen next week as I have my hands full right now. I'll write here with an example. Thanks! |
Just a quick note - I think this has something to do with |
I cannot seem to do anything meaningful. I try removing a bunch of stuff, modifying things, this error doesn't go away. It changes between files, but is always there even if I remove half our code. There's also another very strange error: |
Can you reduce the project to something shareable that exhibits the error or an error? When compiling the whole project, often the first source unit receives the error for the entire compilation batch. This is likely why you are seeing the error move around when you delete stuff. Have you tried opening the Groovy Event Console, cleaning and rebuilding? There may be more information in there is terms of a compilation problem. |
I'll try those things tomorrow. Thanks for the support! |
So when I remove all of our Spock tests, the project compiles fine. When I just have one empty Spock test like: package somepackage
import spock.lang.Specification
class SomeSpec extends Specification {
} Then I get that error. This is with |
I'm not having any problem compiling with spock-core-1.2-groovy-2.5. Can you send a small project that demonstrates the error? I can't tell what other settings and dependencies you have that may be part of the problem. |
OK, I'll try to create a full reproduction next week. |
OK, here you go. Checkout the repo, run |
@boris-petrov Is this the error you are seeing?
|
In order to resolve the assignment within this method, the compiler is trying to find the common super class of static void getMongoCollection(CodecProvider codecProvider = null) {
codecProvider = codecProvider ?: new BaseObjectCodecProvider()
} |
Ready to test |
@eric-milles - thank you for the support and fix! Seems fine now. I'll close the issue. Thanks again! |
I've been using groovy-eclipse fine. Today I updated the Groovy compiler from 2.4.x to 2.5.4 and I started getting this error. It doesn't happen when I build my project with Gradle (which also has 2.5.4). I'm using Eclipse Version: 2018-09 (4.9.0) and the snapshot build of groovy-eclipse. Any ideas?
The text was updated successfully, but these errors were encountered: