Skip to content

given with named context bound and with shorthand causes private reference error #23070

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
eejbyfeldt opened this issue Apr 30, 2025 · 0 comments
Labels
area:implicits related to implicits itype:bug

Comments

@eejbyfeldt
Copy link

eejbyfeldt commented Apr 30, 2025

Compiler version

3.6.4

Minimized code

trait TC[T]:
  type X
given [T: TC as tc](using x: tc.X): TC[List[T]] with {}

Output

-- Error: with_and_as_syntax.scala:3:26 ---
3 |given [T: TC as tc](using x: tc.X): TC[List[T]] with {}
  |                          ^
  |non-private given instance x in class given_TC_List refers to private given instance tc
  |in its type signature given_TC_List.this.tc.X

Expectation

The code should compile without errors.

@eejbyfeldt eejbyfeldt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 30, 2025
@Gedochao Gedochao added area:implicits related to implicits and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:implicits related to implicits itype:bug
Projects
None yet
Development

No branches or pull requests

2 participants