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

The method in in FixtureAnyFreeSpecLike is not declared as infix causing Scala 3.1 to stop with error #2168

Open
wasowski opened this issue Oct 7, 2022 · 2 comments

Comments

@wasowski
Copy link

wasowski commented Oct 7, 2022

This is the error message when I am trying to use in in an AnyFreeSpec style test:

[error] 32 |     "between Int observes the bounds" in check {
[error]    |                                       ^^
[error]    |Alphanumeric method in is not declared `infix`; it should not be used as infix operator
[error]    |The operation can be rewritten automatically to `in` under -deprecation -rewrite.
[error]    |Or rewrite to method syntax .in(...) manually.
[error] -- Error: /home/wasowski/work/symsim/src/test/scala/symsim/concrete/RandomizedSpec.scala:111

This is with Scalatest 3.2.14, scalatestplus scalacheck-1-17 3.2.14.0, and Scala 3.1.3.

Actually just noticed that this may affect many methods in the internal DSL of scalatest. I am getting the same errors for the matchers sublanguage:

[error] 36 |      withClue ("3,2") { policy (3,2) should (be (Left) or be (Up))  }
[error]    |                                                        ^^
[error]    |Alphanumeric method or is not declared `infix`; it should not be used as infix operator
[error]    |The operation can be rewritten automatically to `or` under -deprecation -rewrite.
[error]    |Or rewrite to method syntax .or(...) manually.

Should possibly be filed under another issue (or this one should be renamed).

The issue is only present when compiling with -source:future and -Xfatal-warnings flag (apparently this is still not an error in Scala 3.1.3).

@cheeseng
Copy link
Contributor

cheeseng commented Oct 7, 2022

@wasowski Bummer, it seems like my last round of cleaning for ScalaTest DSL didn't cover all. I'll work further on style traits DSL (first case in your example) and the missed and/or in matchers DSL. I'll try to see if there's more DSL needed infix, in case you notice do feel free to leave a comment here.

Thanks!

@cheeseng
Copy link
Contributor

cheeseng commented Oct 8, 2022

@wasowski Fyi I submitted the following PR for this:

#2170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants