Skip to content

Commit 2bfa8e2

Browse files
authored
Merge pull request #11960 from dotty-staging/fix-11885b
Fix #11885: Always clone trees if position already set
2 parents a806a84 + d458cf0 commit 2bfa8e2

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

compiler/src/dotty/tools/dotc/ast/Positioned.scala

+4-5
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Src
6565
if (span == mySpan) this
6666
else {
6767
val newpd: this.type =
68-
if (mySpan.isSynthetic) {
69-
if (!mySpan.exists && span.exists)
70-
envelope(source, span.startPos) // fill in children spans
68+
if !mySpan.exists then
69+
if span.exists then envelope(source, span.startPos) // fill in children spans
7170
this
72-
}
73-
else cloneIn(source)
71+
else
72+
cloneIn(source)
7473
newpd.span = span
7574
newpd
7675
}

compiler/test/dotty/tools/dotc/IdempotencyTests.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ class IdempotencyTests {
1818
import IdempotencyTests._
1919
import CompilationTest.aggregateTests
2020

21-
// Flaky test on Windows
22-
// https://github.com/lampepfl/dotty/issues/11885
23-
val filter = FileFilter.exclude("i6507b.scala")
21+
// ignore flaky tests
22+
val filter = FileFilter.NoFilter
2423

2524
@Category(Array(classOf[SlowTests]))
2625
@Test def idempotency: Unit = {

0 commit comments

Comments
 (0)