Skip to content

Inferred generic type in macro is inconsistent between Scala 2.13 and Scala 3 #23029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andrzejressel opened this issue Apr 22, 2025 · 1 comment
Labels
area:metaprogramming:quotes Issues related to quotes and splices area:variance Issues related to covariance & contravariance. itype:bug regression:scala2

Comments

@andrzejressel
Copy link
Contributor

Compiler version

  • 3.6.3
  • 3.7.0-RC3

Minimized code

https://github.com/andrzejressel/generic-type-in-macro-bug-report

Output

Scala 2.13

Invariant type T is: String
Covariant type T is: Nothing
Contravariant type T is: Any
Wrapper invariant type T is: String
Wrapper covariant type T is: Nothing
Wrapper contravariant type T is: String

Scala 3

Invariant type T is: java.lang.String
Covariant type T is: java.lang.String
Contravariant type T is: java.lang.String
Wrapper invariant type T is: java.lang.String
Wrapper covariant type T is: scala.Nothing
Wrapper contravariant type T is: scala.Any

Expectation

I would expect them to look the same - in my case the issue is with Wrapper contravariant type losing type in Scala 3.

@andrzejressel andrzejressel added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 22, 2025
@Gedochao Gedochao added area:metaprogramming:quotes Issues related to quotes and splices regression:scala2 area:variance Issues related to covariance & contravariance. and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 24, 2025
@Gedochao
Copy link
Contributor

@jchyb is this expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metaprogramming:quotes Issues related to quotes and splices area:variance Issues related to covariance & contravariance. itype:bug regression:scala2
Projects
None yet
Development

No branches or pull requests

2 participants