Skip to content
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

Capture set inference interacts problematically with inferred impure type variables #18881

Closed
Linyxus opened this issue Nov 8, 2023 · 0 comments · Fixed by #18885
Closed
Labels
area:experimental:cc Capture checking related cc-experiment Intended to be merged with cc-experiment branch on origin itype:bug

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Nov 8, 2023

Compiler version

main

Minimized code

import language.experimental.captureChecking

trait Resource
def id[X](x: X): x.type = x
def foo[M <: Resource](r: M^) = id(r)

Output

-- [E007] Type Mismatch Error: issues/cc-setup-impure-classes.scala:5:35 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
5 |def foo[M <: Resource](r: M^) = id(r)
  |                                   ^
  |                                   Found:    (r : M^)
  |                                   Required: M
  |
  | longer explanation available when compiling with `-explain`
1 error found

Expectation

It should work.

@Linyxus Linyxus added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 8, 2023
@Kordyjan Kordyjan added cc-experiment Intended to be merged with cc-experiment branch on origin area:experimental:cc Capture checking related and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:experimental:cc Capture checking related cc-experiment Intended to be merged with cc-experiment branch on origin itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants