Skip to content

Commit 5571d84

Browse files
committed
move pos test to pos-special/isInstanceOf
1 parent bc225a8 commit 5571d84

File tree

9 files changed

+1
-22
lines changed

9 files changed

+1
-22
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class CompilationTests extends ParallelTesting {
7878
) +
7979
compileFilesInDir("tests/pos-special/spec-t5545", defaultOptions) +
8080
compileFilesInDir("tests/pos-special/strawman-collections", defaultOptions) +
81+
compileFilesInDir("tests/pos-special/isInstanceOf", defaultOptions.and("-Xfatal-warnings")) +
8182
compileFile("scala2-library/src/library/scala/collection/immutable/IndexedSeq.scala", defaultOptions) +
8283
compileFile("scala2-library/src/library/scala/collection/parallel/mutable/ParSetLike.scala", defaultOptions) +
8384
compileList(

tests/neg-custom-args/isInstanceOf/3324c.scala renamed to tests/pos-special/isInstanceOf/3324c.scala

-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ class Test {
55
def f(x: B[Int]) = x match { case _: A[Int] if true => }
66

77
def g(x: A[Int]) = x match { case _: B[Int] => }
8-
9-
def foo(x: Any) = x.isInstanceOf[List[String]] // error
108
}

tests/neg-custom-args/isInstanceOf/3324d.scala renamed to tests/pos-special/isInstanceOf/3324d.scala

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@ class Test {
55
case _: List[Int @unchecked] => 5
66
case _: List[Int] @unchecked => 5
77
}
8-
9-
def foo(x: Any): Boolean =
10-
x.isInstanceOf[List[String]] // error
118
}

tests/neg-custom-args/isInstanceOf/3324e.scala renamed to tests/pos-special/isInstanceOf/3324e.scala

-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,4 @@ class C[T] {
1414
z match {
1515
case x: F[T] =>
1616
}
17-
18-
def foo(x: Any): Boolean =
19-
x.isInstanceOf[List[String]] // error
2017
}

tests/neg-custom-args/isInstanceOf/3324h.scala renamed to tests/pos-special/isInstanceOf/3324h.scala

-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ object Test {
55
case _: T with Marker => // scalac emits a warning
66
case _ =>
77
}
8-
9-
def bar(x: Any) = x.isInstanceOf[List[String]] // error
108
}

tests/neg-custom-args/isInstanceOf/Result.scala renamed to tests/pos-special/isInstanceOf/Result.scala

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@ object p {
55
case OK [T](x: T) extends Result[T, Nothing]
66
case Err[E](e: E) extends Result[Nothing, E]
77
}
8-
9-
def foo(x: Any): Boolean =
10-
x.isInstanceOf[List[String]] // error
118
}

tests/neg-custom-args/isInstanceOf/classTag.scala renamed to tests/pos-special/isInstanceOf/classTag.scala

-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@ object IsInstanceOfClassTag {
77
case _ => None
88
}
99
}
10-
11-
def foo(x: Any): Boolean =
12-
x.isInstanceOf[List[String]] // error
1310
}

tests/neg-custom-args/isInstanceOf/gadt.scala renamed to tests/pos-special/isInstanceOf/gadt.scala

-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,4 @@ object Test {
3434
}
3535

3636
eval(exp)(Env.empty)
37-
38-
def foo(x: Any): Boolean =
39-
x.isInstanceOf[List[String]] // error
4037
}

tests/neg-custom-args/isInstanceOf/t2755.scala renamed to tests/pos-special/isInstanceOf/t2755.scala

-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,4 @@ object Test {
5555
println(f3(Array(1L)))
5656
println(f3(null))
5757
}
58-
59-
def foo(x: Any): Boolean =
60-
x.isInstanceOf[List[String]] // error
6158
}

0 commit comments

Comments
 (0)