julianpeeters / sbt-avrohugger

sbt plugin for generating Scala sources for Apache Avro schemas and protocols.
Apache License 2.0
133 stars 50 forks source link

match may not be exhaustive issue #91

Open OhohLeo opened 2 years ago

OhohLeo commented 2 years ago

Hello,

I am facing a compilation issue on avro generated code when updating my scala application using sbt-avrohugger library.

My versions :

Here is an exemple of the failing code :

[error] .../target/scala-2.13/src_managed/main/compiled_avro/com/qosenergy/qng/models.scala:319:9: match may not be exhaustive.
[error] It would fail on the following input: (x: Any forSome x not in Long)
[error]         value match {
[error]         ^

coming from this generated code : image

generated from this avro exerpt : image

Do you know how to solve this compilation issue ?

julianpeeters commented 2 years ago

Thanks for reporting, the timeline for a fix is pretty far off, but as a workaround you may like to try turning off your linter, or else look into silencing your target directory: https://github.com/scala/scala/pull/8373