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

Parameter substitution for reach capabilities not working #20202

Closed
Linyxus opened this issue Apr 16, 2024 · 0 comments · Fixed by #20203
Closed

Parameter substitution for reach capabilities not working #20202

Linyxus opened this issue Apr 16, 2024 · 0 comments · Fixed by #20203
Labels
area:experimental:cc Capture checking related itype:bug
Milestone

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Apr 16, 2024

Compiler version

main

Minimized code

import language.experimental.captureChecking

trait Source[+T]

def race[T](sources: Seq[Source[T]^]): Source[T]^{sources*} = raceImpl(sources)

def raceImpl[T](sources: Seq[Source[T]^]): Source[T]^{sources*} = ???

Output

-- [E007] Type Mismatch Error: issues/source.scala:5:70 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5 |def race[T](sources: Seq[Source[T]^]): Source[T]^{sources*} = raceImpl(sources)
  |                                                              ^^^^^^^^^^^^^^^^^
  |                                                              Found:    Source[box T^?]^{sources*}
  |                                                              Required: Source[T]^{sources²*}
  |
  |                                                              where:    sources  is a reference to a value parameter
  |                                                                        sources² is a parameter in method race
  |
  | longer explanation available when compiling with `-explain`
1 error found

Expectation

Should compile.

Found by @natsukagami while capture checking gears.

@Linyxus Linyxus added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:experimental:cc Capture checking related and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 16, 2024
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
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 itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants