Scala2 / 3 handles type argument differently
See original GitHub issueCompiler version
3.0.1.RC-2
Minimized code
class Schema(impl: Class[_]) extends scala.annotation.StaticAnnotation
case class Foo[A](@Schema(classOf[List[A]]) foo: String)
Output
[error] 31 | case class Foo[A](@Schema(classOf[List[A]]) foo: String)
[error] | ^
[error] | Not found: type A
Expectation
It should compile, since it does on Scala 2.13.6.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to define "type disjunction" (union types)? - Stack Overflow
Scala handles overloading differently and, it must be admitted, somewhat less elegantly than you describe. Some of that's due to Java interoperability, some...
Read more >Inline | Macros in Scala 3
Our example method logged uses three different kinds of parameters, illustrating that inlining handles those parameters differently: By-value parameters.
Read more >4. Pattern Matching - Programming Scala, 2nd Edition [Book]
With Scala's pattern matching, your cases can include types, wildcards, ... Finally, sometimes we want to handle several different matches with the same...
Read more >Scala 3 macros tips & tricks - SoftwareMill
Some of the things we've learned when implementing a number of macros using Scala 3. A handy guide to start metaprogramming with Scala....
Read more >Overloading Resolution + Vararg methods: example should ...
There's an issue somewhere with the example with a type parameter. ... scala> def f(x: Object) = 0 f: (x: Object)Int scala> f(1,2,3)...
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 had a stray
A
on my classpath. That’s why it compiled for me.So, yes, that’s right now simply not supported. Here’s what it says for the method that computes the context to be used for an annotation
It will take some effort to change this