Comments (7)
Couldn't reproduce in Scastie:
Then the reproduction from https://github.com/little-inferno/chimney-error worked.
However, commenting out
//ThisBuild / scalacOptions += "-Ymacro-annotations"
make the code work again. I am not sure what is the cause, but presence of "-Ymacro-annotations"
changes what macros sees internally, I suspect that we might have a workaround for such cases which did not survive the rewrite as it's difficult to have a regression test for something as unpredictable as compiler flag changing the data available to the macro. I might take a look at this somewhere in the next week if I'll have the time.
from chimney.
I have something local, but I'd need to add regression tests to make sure it works and would keep working.
from chimney.
As far as I tested the fix I merged worked. I tested with local snapshot, once https://github.com/scalalandio/chimney/actions/runs/9761346064/job/26942175116 passed you might check as well with a Sonatype OSS shapshots.
from chimney.
Yes, it seems that using -Ymacro-annotations
change decoded name from
apply$default$idx
to
<init>$default$idx
And this matching give an error
I wrote dirty quickfix and it fix compilation errors in https://github.com/little-inferno/chimney-error
from chimney.
My local fix was quite similar to your - I'd add a test for default value in a class which is not case class
, and maybe something with -Ymacro-annotations
. I suspect that missing tpe.typeSymbol.typeSingature
was the issue, since there was an unfixed bug in Scala 2 macros when sometimes type symbol is not initialized until this method is called (even if it's completely not needed). But I haven't tested this PR at all.
from chimney.
Great, there are no more errors with the default parameters 🎉
from chimney.
Released in 1.3.0
from chimney.
Related Issues (20)
- [PartialTransformer] Field Option[Field].None to Proto3.Fields.Default
- ClassCastException thrown on Scala 3 when transforming sealed traits to Protobuf GeneratedEnum HOT 12
- Automatic Coproduct Rename from/to Protobuf GeneratedEnum HOT 8
- Can't transform coproduct - Java Enum to Sealed trait HOT 24
- Cannot transform Scala class to Java class HOT 5
- Chimney stabilization into 1.0.0
- Exclude macro generated code from WartRemover checks HOT 16
- Fix Overrides for Subtypes matching
- Support seamless transformation of protobuf oneof types HOT 4
- Compiler bugs: known, relevant and unresolved/undocumented
- Support transformation to and from Java primitives
- Test more Scala CLI snippets for output (printed results)
- Support runtime-defined enums
- Rewrite Patchers as a special case of multiple case classes mapping
- Refactor internals to NOT rely on RuntimeDataStore
- Total transformation for Cats' `NonEmptyX[A] -> NonEmptyX[B]` HOT 3
- Possible documentation improvements
- Macro is ignoring overrides in collections when From =:= Target
- More utilities in chimney-macro-commons
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chimney.