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

be Scala 2.13.3 friendly (Symbol#toString changed) #1808

Merged
merged 1 commit into from May 11, 2020

Conversation

SethTisue
Copy link
Contributor

@SethTisue SethTisue commented May 5, 2020

the old code relied on this assumption:
mySymbol.name == mySymbol.toString.drop(1)
but Scala 2.13.3 is changing Symbol#toString to be
e.g. Symbol(foo) instead of 'foo

the new code works fine on any Scala version. I cannot see
any reason for the old code to be the way it was

the old code relied on this assumption:
`mySymbol.name == mySymbol.toString.drop(1)`
but Scala 2.13.3 is changing Symbol#toString to be
e.g. `Symbol(foo)` instead of `'foo`

the new code works fine on any Scala version.  I cannot see
any reason for the old code to be the way it was
@SethTisue
Copy link
Contributor Author

This issue came up in the Scala community build. Not only did ScalaTest's own tests fail on 2.13.3-bin-43b70d4, but downstream projects were also affected.

I suggest that you roll a 3.1.x release with this fix sooner rather than later, in the hopes that by the time 2.13.3 is released and people upgrade to it, many people will already be on the new ScalaTest version and thus will never notice any problem.

@SethTisue
Copy link
Contributor Author

Not sure whether a 3.0.x backport-and-release is worth the trouble, or if you just want to tell 3.0.x users who hit this that they just ought to move to 3.1.x.

@cheeseng
Copy link
Contributor

cheeseng commented May 7, 2020

@SethTisue I am looking into this now, thanks for the fix!

@cheeseng
Copy link
Contributor

cheeseng commented May 7, 2020

I tested this fix with scala version 2.10-2.13, scala-js, and native build, seems to work correctly.

@bvenners Do you mind if we release a 3.1.2 for this?

@bvenners
Copy link
Contributor

bvenners commented May 8, 2020

@cheeseng Yes, let's do a 3.1.2 release with this fix.

@SethTisue
Copy link
Contributor Author

I think a number of your tests are also going to fail on 2.13.3; I see a number of places like:

    describe("a(Symbol) method returns Matcher") {
      val mt = be a ('file)
      
      it("should have pretty toString") {
        mt.toString should be ("be a 'file")
      }

where it now comes out as be a Symbol(file)

that's a lesser concern than the one I addressed in this PR, of course.

@bvenners bvenners merged commit 2e13d86 into scalatest:3.1.x May 11, 2020
@SethTisue SethTisue deleted the symbol-2.13.3 branch May 11, 2020 14:15
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

Successfully merging this pull request may close these issues.

None yet

3 participants