Skip to content

Missing methods in SeqViewOps in Scala 2 library CC #19988

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
Linyxus opened this issue Mar 20, 2024 · 0 comments · Fixed by #19993
Closed

Missing methods in SeqViewOps in Scala 2 library CC #19988

Linyxus opened this issue Mar 20, 2024 · 0 comments · Fixed by #19993
Assignees
Labels
area:experimental:cc Capture checking related itype:bug
Milestone

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Mar 20, 2024

Compiler version

main

Minimized code

To reproduce, set the stdlib to the capture checked one and compile the snippet:

> set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty
> scala3-bootstrapped/scalac Hello.scala
import collection.IndexedSeqView
object Hello extends App {
  def foo(view: IndexedSeqView[Int]): Unit =
    val x1 = 1 +: view
    val x2 = view :+ 1
}

Output

-- [E008] Not Found Error: Hello.scala:4:15 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4 |    val x1 = 1 +: view
  |               ^^^^^^^
  |               value +: is not a member of scala.collection.IndexedSeqView[Int] - did you mean view.++? or perhaps view.++: or view./:?
-- [E008] Not Found Error: Hello.scala:5:18 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5 |    val x2 = view :+ 1
  |             ^^^^^^^
  |             value :+ is not a member of scala.collection.IndexedSeqView[Int] - did you mean view.++? or perhaps view.:\?
2 errors found

Expectation

It should compile.

@Linyxus Linyxus added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 20, 2024
@Linyxus Linyxus self-assigned this Mar 20, 2024
@Linyxus Linyxus added area:experimental:cc Capture checking related and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 20, 2024
Linyxus added a commit to dotty-staging/dotty that referenced this issue Mar 22, 2024
odersky added a commit that referenced this issue Mar 23, 2024
fixes #19988

The issue is caused by the change of class hierarchy in Scala 2 library
CC: `SeqView` no longer extends `SeqOps`. To fix this we have to copy
methods from `SeqOps` to `SeqViewOps`. Similar to what is done in
#19873.
@Kordyjan Kordyjan added this to the 3.4.2 milestone Mar 28, 2024
@Kordyjan Kordyjan modified the milestones: 3.4.2, 3.5.0 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