Skip to content

transparent inline def leaks opaque type #14305

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
bishabosha opened this issue Jan 20, 2022 · 2 comments
Closed

transparent inline def leaks opaque type #14305

bishabosha opened this issue Jan 20, 2022 · 2 comments

Comments

@bishabosha
Copy link
Member

bishabosha commented Jan 20, 2022

Compiler version

3.1.0

Minimized code

class Example {
  opaque type Index = Array[Int]
  transparent inline def index(using index: Index): Index = index
}

object Usage {
  def run(example: Example)(using example.Index): Unit = {
    example.index.length
  }
}

Output

Compiles ok

Expectation

length should not be a member of the result of example.index when in the scope of Usage

@soronpo
Copy link
Contributor

soronpo commented Jan 20, 2022

Could be a duplicate of #13461

@nicolasstucki
Copy link
Contributor

I added it to #13461

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

4 participants