Quantcast

Scala compiler expects package?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Scala compiler expects package?

Shannon Carey
I'm getting errors like this one when I have a .java file in my generated-sources (in Maven) that does not have a package declaration.

[ERROR] /..../target/generated-sources/avro/destination_intent.java:8: error: `package' expected but `public' found.

[INFO] public class destination_intent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {

[INFO] ^


The error appears to be coming from scala.tools.nsc.Main. Do you agree that this is a problem with the Scala compiler? Does anyone know of a workaround?


I understand that using the default package is not desirable, but in this case (using an Avro schema generated from a Parquet file) it is difficult to avoid.


Thanks!

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Scala compiler expects package?

Adriaan Moors-7
Hi,

Sounds like a bug to me. Does the generated file contain an annotation before the class definition at line 8 by any chance?
Please file a ticket at https://github.com/scala/bug, including the lines leading up to the class definition in your report.

cheers
adriaan

On Wed, Apr 26, 2017 at 5:21 PM Shannon Carey <[hidden email]> wrote:
I'm getting errors like this one when I have a .java file in my generated-sources (in Maven) that does not have a package declaration.

[ERROR] /..../target/generated-sources/avro/destination_intent.java:8: error: `package' expected but `public' found.

[INFO] public class destination_intent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {

[INFO] ^


The error appears to be coming from scala.tools.nsc.Main. Do you agree that this is a problem with the Scala compiler? Does anyone know of a workaround?


I understand that using the default package is not desirable, but in this case (using an Avro schema generated from a Parquet file) it is difficult to avoid.


Thanks!

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...