Regression macro between M3 and RC1 - transparent inline
See original GitHub issueCompiler version
This is an error we encountered when migrating Monocle from Scala 3.0.0-M3 to 3.0.0-RC1.
Here is the link to the build: https://github.com/optics-dev/Monocle/runs/1917837206
Minimized code
object GenPrism {
transparent inline def apply[Source, Target <: Source] =
Focus[Source](_.as[Target])
}
object Focus {
def apply[S] = new MkFocus[S]
class MkFocus[From] {
transparent inline def apply[To](inline lambda: (From => To)): Any =
${ FocusImpl('lambda) }
}
}
Output
[error] -- Error: /Users/julien/project/Monocle/macro/src/main/scala-3.x/monocle/macros/GenPrism.scala:8:22
[error] 8 | Focus[Source](_.as[Target])
[error] | ^^^^^^^^^^^^
[error] | class Nothing in package scala does not take type parameters
[error] -- Error: /Users/julien/project/Monocle/macro/src/main/scala-3.x/monocle/macros/GenPrism.scala:7:25
[error] 7 | transparent inline def apply[Source, Target <: Source] =
[error] | ^
[error] | `transparent` can only be used for inline methods
Expectation
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Announcing Dotty 0.22.0-RC1 - syntactic enhancements, type ...
We are excited to announce 0.22.0-RC1 of Dotty. This version brings syntactic enhancements for extension methods and context parameters, as well ...
Read more >Milestones - scala/scala · GitHub
This milestone is focused on settling the new collections API, and any fixes directly needed for that. Anything else should go to M5....
Read more >Zephyr 1.6 rc1 - devel@lists.zephyrproject.org
samples: use printf/printk directly instead of macros ... tests: fix filter for cortex-m3/m4 ... unified: Exclude inline assembler blocks from Doxygen
Read more >[PATCH 5.13 000/175] 5.13.10-rc1 review - kernel
[PATCH 5.13 000/175] 5.13.10-rc1 review @ 2021-08-10 17:28 Greg ... Jens Axboe <axboe@kernel.dk> io-wq: fix race between worker exiting and activating free ...
Read more >Untitled
... rds: Force ordering of {set,clear}_bit operating on m_flags (Hakon Bugge) ... Convert MAKE_HANDLE() from a define into an inline function (Bart Van ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, I wasn’t sure how to minimise it. Though I don’t understand why it stopped working between M3 and RC1.
@smarter Thanks for pointing out the community build, I will look at adding Monocle
Can you open an issue with the as method present that reproduces the problem?