Skip to content

transparent inline within transparent inline looses type refinement #14007

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

Closed
soronpo opened this issue Nov 26, 2021 · 2 comments
Closed

transparent inline within transparent inline looses type refinement #14007

soronpo opened this issue Nov 26, 2021 · 2 comments

Comments

@soronpo
Copy link
Contributor

soronpo commented Nov 26, 2021

Compiler version

v3.1.0

Minimized code

https://scastie.scala-lang.org/iVSSZgQyQt6TAeTniSCFtQ

trait Id[T]{type Out <: Int}
transparent inline def internal [T <: Int]: Id[T] = new Id[T]{type Out = T}

transparent inline def id: Int =
  val one = internal[1]
  ??? : one.Out

val i : 1 = id

Output

Found:    Int
Required: (1 : Int)

Expectation

No error.

@smarter
Copy link
Member

smarter commented Nov 26, 2021

Duplicate of #8739

@smarter smarter marked this as a duplicate of #8739 Nov 26, 2021
@smarter smarter closed this as completed Nov 26, 2021
@soronpo
Copy link
Contributor Author

soronpo commented Nov 26, 2021

You see, I completely forgot about this issue so that evidently I was the one who submitted the previous issue that was closed as a duplicate. It's such a huge issue and very annoying to work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants