Scala compiler expects package?

25 views
Skip to first unread message

Shannon Carey

unread,
Apr 26, 2017, 8:21:47 PM4/26/17
to scala-user
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!

Adriaan Moors

unread,
Apr 26, 2017, 9:28:11 PM4/26/17
to Shannon Carey, scala-user
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

--
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 scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages