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

Check files need to be more versatile for compilation tests with CC Scala 2 library #19847

Closed
Linyxus opened this issue Mar 1, 2024 · 1 comment · Fixed by #19873
Closed
Assignees
Labels
area:experimental:cc Capture checking related itype:bug
Milestone

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Mar 1, 2024

Compiler version

main

Minimized code

The problem is that the error messages in negative tests may look different when compiled with CC Scala 2 library.

Steps for reproduce an example:

sbt> set ThisBuild/Build.scala2Library := Build.Scala2LibraryCCTasty
sbt> scala3-bootstrapped/testCompilation abstract-givens

Output

The test fails with the diff:

index 022c454c31..343ce5ecbd 100644
--- a/tests/neg/abstract-givens.check
+++ b/tests/neg/abstract-givens.check.out
@@ -1,7 +1,7 @@
 -- Error: tests/neg/abstract-givens.scala:11:8 -------------------------------------------------------------------------
 11 |  given s[T](using T): Seq[T] with // error
    |        ^
-   |instance cannot be created, since def iterator: Iterator[A] in trait IterableOnce in package scala.collection is not defined 
+   |instance cannot be created, since def iterator: Iterator[A]^{this} in trait IterableOnce in package scala.collection is not defined 
 -- [E164] Declaration Error: tests/neg/abstract-givens.scala:8:8 -------------------------------------------------------
 8 |  given y(using Int): String = summon[Int].toString * 22 // error
   |   
@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 Mar 1, 2024
@odersky
Copy link
Contributor

odersky commented Mar 1, 2024

Which other files are failing with check errors?

Maybe we can tweak the error message rendering so that capture sets are printed only if the current compilation unit is itself capture checked?

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
3 participants