Macro implicits don't work outside package
See original GitHub issueIssue Description
Hey. Check this out: https://github.com/japgolly/upickle/commit/9a976af73ed46eeb7364829e457a973719ed9a7b
Eg2
compiles but Eg1
doesn’t.
[error] upickle/jvm/shared/test/scala/upickle/blah/blah.scala:7: uPickle does not know how to read [upickle.elsewhere.YYY]s; define an implicit Reader[upickle.elsewhere.YYY] to teach it how
[error] def blah(j: String): YYY = read[YYY](j)
[error] ^
[warn] one warning found
[error] one error found
[error] upickle/js/shared/test/scala/upickle/blah/blah.scala:7: uPickle does not know how to read [upickle.elsewhere.YYY]s; define an implicit Reader[upickle.elsewhere.YYY] to teach it how
[error] def blah(j: String): YYY = read[YYY](j)
[error] ^
[warn] one warning found
[error] one error found
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (13 by maintainers)
Top Results From Across the Web
Cannot resolve macro in implicit extern crates #3210 - GitHub
IntelliJ doesn't correctly resolve external crate macros when not explicitly marked in main/lib file and with a #[macro_use] . At a guess, I'm ......
Read more >How do I use a macro across module files? - Stack Overflow
I want to use the macros defined in one module in another module. // macros.rs #[macro_export] // or not? is ineffectual for this,...
Read more >Macros from the internet will be blocked by default in Office
Provides guidance for admins about how Office blocks macros in files from the internet.
Read more >Macros - Scala 3
The two types can be defined in package scala.quoted as follows: ... assert that contains a splice operation outside an enclosing quote is...
Read more >Def Macros - Scala Documentation
String . This also means that the code below won't work for printf(get_format(), ...) , because in that case format ...
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
I knew that this issue made it so risky to choose upickle for a project and yet I did it again and here I am, chasing this issue for 3 hours… Even though my code is entirely within a single package and I know about a few other tricks that usually solved it like proper ordering and avoiding nested classes… And still god damn :
The incremental compiler in Intellij is the biggest trap because it works works works until you do
sbt clean
and find it doesn’t work god knows why after 2 hours of development…Anyway, rules of thumb :
Btw the @japgolly’s trick with “implicit realization close to data source” doesn’t work for me…
Moot with 0.5.1