Skip to content

Inline looses dependent type #13882

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 5, 2021 · 1 comment
Closed

Inline looses dependent type #13882

soronpo opened this issue Nov 5, 2021 · 1 comment

Comments

@soronpo
Copy link
Contributor

soronpo commented Nov 5, 2021

Compiler version

v3.1.0

Minimized code

trait Exactly {type Out}
transparent inline def one(): Exactly = new Exactly{type Out = 1}

inline def check(): Unit =
  val exact = one()
  compiletime.summonInline[exact.Out =:= 1]

val x = check()

Output

Cannot prove that exact.Out =:= (1 : Int).

Expectation

No error.

@nicolasstucki
Copy link
Contributor

This is another instance of #8739. The limitation is that the type of the val does not get more precise when inlined.

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

3 participants