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

run more expect tests against Scala 3 #1952

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

bjaglin
Copy link
Collaborator

@bjaglin bjaglin commented Mar 3, 2024

Rationale: ensure good coverage & detect potential Scalameta regressions

@@ -17,6 +17,8 @@ Disable.symbols = [

package test.escapeHatch

import test.disableSyntax.DisableSyntaxMoreRules.toString
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[error] 37 |    None + "foo",
[error]    |    ^^^^^^
[error]    |value + is not a member of object None, but could be made available as an extension method.
[error]    |
[error]    |The following import might fix the problem:
[error]    |
[error]    |  import test.disableSyntax.DisableSyntaxMoreRules.toString
[error]    |

def this(eDummy: String, fDummy: String) {
this
def this(eDummy: String, fDummy: String) = {
this()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[error] 123 |      this
[error]     |          ^
[error]     |None of the overloaded alternatives of constructor DummyClass_6 in class DummyClass_6 with types
[error]     | (eDummy: String, fDummy: String): test.escapeHatch.AnnotationScopes.DummyClass_6
[error]     | (): test.escapeHatch.AnnotationScopes.DummyClass_6
[error]     |match arguments ((??? : => Nothing))

@@ -25,8 +25,6 @@ object AnnotationScopes {

class Foo_0[DummyTypeParam] // assert: NoDummy

def dummyMacro_0: Unit = macro ??? // assert: NoDummy
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[error]    |  ^
[error]    |  No Scala 3 implementation found for this Scala 2 macro.

I decided it was niche enough to just drop the test case


object AnchorPatches {
def d1s = Duration(1, "s")
def d2s = Duration(2, "s") // scalafix:ok ExplicitResultTypes
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewrote the test to leverage RemoveUnused only, as ExplicitResultTypes is not available on Scala 3, thus the undetected rename

Comment on lines +11 to +12
// Fails with Scala3 dialect as the second silencer is not attached to the Defn.Val
// https://github.com/scalameta/scalameta/issues/3689
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjaglin bjaglin force-pushed the scala3-moreexpecttests branch 2 times, most recently from 9e440d8 to 54d1bca Compare April 13, 2024 17:09
Comment on lines +13 to +15
// Unsupported on Scala 3
// https://github.com/scala/scala3/issues/12766
// https://github.com/scalacenter/scalafix/blob/f51cb4a/docs/rules/OrganizeImports.md?plain=1#L440-L444
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +6 to +7
// Not available as of Scala 3.4.1
// https://github.com/scalacenter/scalafix/issues/1937
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjaglin bjaglin marked this pull request as ready for review April 13, 2024 17:23
@bjaglin bjaglin merged commit 089ec8b into scalacenter:main Apr 13, 2024
9 checks passed
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.

1 participant