Skip to content

Commit db974a3

Browse files
Isolate the two failing tests in run-not-optimised
1 parent 0c62f02 commit db974a3

File tree

6 files changed

+55
-11
lines changed

6 files changed

+55
-11
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ class CompilationTests extends ParallelTesting {
168168
@Test def runAll: Unit =
169169
compileFilesInDir("../tests/run", defaultOptions).checkRuns()
170170

171+
// The two tests that current fail under -optimise
172+
@Test def runNotOptimised: Unit =
173+
compileFilesInDir("../tests/run-not-optimised", defaultOptions.filterNot("-optimise".==)).checkRuns()
174+
171175
// Pickling Tests ------------------------------------------------------------
172176
//
173177
// Pickling tests are very memory intensive and as such need to be run with a

tests/pending/t7126.scala

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.

tests/run-not-optimised/t4859.scala

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
object O {
2+
case class N()
3+
object P
4+
}
5+
6+
object Outer {
7+
println("Outer")
8+
object Inner {
9+
println("Inner")
10+
def i: Unit = {
11+
println("Inner.i")
12+
}
13+
}
14+
}
15+
16+
object Test {
17+
def main(args: Array[String]): Unit = {
18+
Outer.Inner.i // we still don't initialize Outer here (but should we?)
19+
20+
{println("About to reference Inner.i"); Outer}.Inner.i // Outer will be initialized.
21+
22+
{println("About to reference O.N" ); O}.N
23+
24+
{println("About to reference O.N" ); O}.N
25+
26+
{println("About to reference O.N.apply()"); O}.N.apply()
27+
}
28+
}
29+

tests/run-not-optimised/t7126.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import language._
2+
3+
// Currently typer infers a Nothing as a CC[T] to be Nothing[T], and isn't
4+
// able to figure out that Nothing[Any] =:= Nothing. We've had a discussion
5+
// that it should instead infer CC[T] to be type lambda T => Nothing to be
6+
// kind-correct. #2439
7+
8+
object T7126 {
9+
type T = Any
10+
boom(???): Option[T] // SOE
11+
def boom[CC[U]](t : CC[T]): Option[CC[T]] = None
12+
13+
// okay
14+
foo(???): Option[Any]
15+
def foo[CC[U]](t : CC[Any]): Option[CC[Any]] = None
16+
}
17+
18+
object Test {
19+
def main(args: Array[String]): Unit = ()
20+
}

tests/run/t4859.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ object O {
33
object P
44
}
55

6+
// We assume module initialisation to be pure, running this test under
7+
// -optimise yields different results.
68
object Outer {
79
println("Outer")
810
object Inner {

0 commit comments

Comments
 (0)