Skip to content

Commit fde3c0e

Browse files
committed
fix more tests
1 parent b58ab78 commit fde3c0e

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

compiler/src/dotty/tools/dotc/typer/RefChecks.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ object RefChecks {
12381238
if ctx.explicitNulls && !ctx.isJava
12391239
&& sym.exists && sym.owner.isClass
12401240
&& !sym.owner.isAnonymousClass
1241+
&& !sym.owner.name.isReplWrapperName
12411242
&& !sym.isOneOf(JavaOrPrivateOrSynthetic | InlineProxy | Param | Exported) then
12421243
val resTp = sym.info.finalResultType
12431244
if resTp.existsPart(_.isInstanceOf[FlexibleType], StopAt.Static) then

compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,7 @@ class DottyBytecodeTests extends DottyBytecodeTest {
15911591
assertInvoke(getMethod(c, "f1"), "[Ljava/lang/String;", "clone") // array descriptor as receiver
15921592
assertInvoke(getMethod(c, "f2"), "java/lang/Object", "hashCode") // object receiver
15931593
assertInvoke(getMethod(c, "f3"), "java/lang/Object", "hashCode")
1594-
assertInvoke(getMethod(c, "f4"), "java/lang/Object", "toString")
1594+
assertInvoke(getMethod(c, "f4"), "java/util/Objects", "toString")
15951595
}
15961596
}
15971597

repl/test/dotty/tools/repl/ReplCompilerTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class ReplCompilerTests extends ReplTest:
120120
assert(storedOutput().startsWith("java.lang.StackOverflowError"))
121121

122122
@Test def `i3305 NPE`: Unit = initially:
123-
run("null.toString")
124-
assert(storedOutput().startsWith("java.lang.NullPointerException"))
123+
run("null.hashCode")
124+
assert(storedOutput().contains("java.lang.NullPointerException"))
125125

126126
@Test def `i3305 IAE`: Unit = initially:
127127
run("""throw new IllegalArgumentException("Hello")""")

repl/test/dotty/tools/repl/SaveTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class SaveTests extends ReplTest, SessionFileHelpers {
174174
} andThen {
175175
storedOutput()
176176
run("s.trim")
177-
assertEquals(List("val res0: String = \":help\""), lines())
177+
assertEquals(List("val res0: (String)? = \":help\""), lines())
178178
}
179179

180180
@Test def roundTripsSeparatorInStringViaLoad =

repl/test/dotty/tools/repl/TabcompleteTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ class TabcompleteTests extends ReplTest {
279279
List(
280280
"(separator: Char): Array[String]",
281281
"(separators: Array[Char]): Array[String]",
282-
"(x$0: String): Array[String]",
283-
"(x$0: String, x$1: Int): Array[String]"
282+
"(x$0: (String)?): (Array[(String)?])?",
283+
"(x$0: (String)?, x$1: Int): (Array[(String)?])?"
284284
),
285285
tabCompleteSignatures(""""".split""", "split")
286286
)

0 commit comments

Comments
 (0)