question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression macro between M3 and RC1 - transparent inline

See original GitHub issue

Compiler 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:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
julien-truffautcommented, Feb 17, 2021

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

0reactions
smartercommented, Feb 17, 2021

Can you open an issue with the as method present that reproduces the problem?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found