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? # for a free GitHub account to open an issue and contact its maintainers and the community.

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

Already on GitHub? # to your account

Open
andrzejressel opened this issue Apr 22, 2025 · 0 comments
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label
Projects
None yet
Development

No branches or pull requests

1 participant