Skip to content

Commit

Permalink
Restore workaround for compiletime.testing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKubuszok committed Sep 11, 2023
1 parent 13f2c91 commit f061416
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ trait VersionCompat {
def compileErrorsFixed(code: String): String =
macro MacroCompatScala2.compileErrorsImpl

// TODO: I wish to remove these one day

def compileErrorsScala2(code: String): String =
macro MacroCompatScala2.compileErrorsImpl

def isScala3: Boolean = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ trait VersionCompat {
.mkString("\n")
}

// TODO: I wish to remove these one day :/

transparent inline def compileErrorsScala2(inline code: String): String = ""

def isScala3: Boolean = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ class TotalTransformerSealedHierarchySpec extends ChimneySpec {
shapes1.Rectangle(shapes1.Point(0, 0), shapes1.Point(2, 2))
}

test("not allow transformation of of sealed hierarchies when the transformation would be ambiguous".ignore) {
test(
"not allow transformation of of sealed hierarchies when the transformation would be ambiguous".withTags(
if (isScala3) Set(munit.Ignore)
else Set.empty // ignore only on Scala 3 until https://github.com/lampepfl/dotty/issues/18484 is fixed
)
) {
val error = compileErrorsScala2(
"""
(shapes1.Triangle(shapes1.Point(0, 0), shapes1.Point(2, 2), shapes1.Point(2, 0)): shapes1.Shape)
Expand Down

0 comments on commit f061416

Please sign in to comment.