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
Scalac fails to parse Google Protobuf2.x generated Java file #2377
Comments
Imported From: https://issues.scala-lang.org/browse/SI-2377?orig=1
|
Jhon Honce (jwhonce) said: |
Jhon Honce (jwhonce) said: |
Jhon Honce (jwhonce) said: |
@jorgeortiz85 said: public QueueMessage.Stage.Builder toBuilder() { return newBuilder(this); } However, it's a pain to have to tweak generated code. I'd like to see this bug fixed. |
@paulp said: [paulp@jon 2377 (master)]$$ scalac273 QueueMessage.java
[paulp@jon 2377 (master)]$$ scalac273 QueueMessage.2.java
[paulp@jon 2377 (master)]$$ scalac276 QueueMessage.java
[paulp@jon 2377 (master)]$$ scalac276 QueueMessage.2.java
[paulp@jon 2377 (master)]$$ scalac28 QueueMessage.java
[paulp@jon 2377 (master)]$$ scalac28 QueueMessage.2.java
[paulp@jon 2377 (master)]$$ If you think this is not some sort of maven configuration bug, please tell me how to reproduce it without involving maven (else this ticket will be closed as invalid.) |
Jhon Honce (jwhonce) said: |
Jhon Honce (jwhonce) said: It's not pretty but I attached a tar file with the source files and a bash script showing how the compiler is being invoked. I couldn't include my scala jars because of the upload size limit so you will need to tweak the script to point to your jars before the script will run. I downloaded and built the latest nightly build and can reproduce the issue. There will be a list compiler errors because I only included a subset of files that I found to show the issue. My friend "the ambiguous Builder" message is buried in there. Please let me know if I can provide any other information. TIA for your efforts. |
@paulp said: Oh, and to see the kind of bug isolation I would have appreciated, examine the test case at http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/test/files/pos/t2377/ . |
|| || java version "1.6.0_16" ||
|| || Java(TM) SE Runtime Environment (build 1.6.0_16-b01) ||
|| || Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode) ||
|| || maven2.1 ||
|| Versions that fail || ||
|| || scala-compiler and scala-library 2.7.3 ||
|| || scala-compiler and scala-library 2.7.6 ||
|| || scala-compile and scala-library 2.8.0-SNAPSHOT from http://scala-tools.org/repo-snapshots ||
$$ mvn compile[[br]]
.[[br]]
:[[br]]
[INFO] use scala command with args in file[[br]]
.../QueueMessage.java:627: error: reference to Builder is ambiguous;
it is imported twice in the same scope by[[br]]
import WorkUnit.[[br]]
and import Stage.[[br]]
public Builder toBuilder() { return newBuilder(this); }[[br]]
{{^}}[[br]]
one error found[[br]]
The text was updated successfully, but these errors were encountered: