Skip to content

Commit 8d7ae72

Browse files
committed
Workaround #341
1 parent ea275e1 commit 8d7ae72

File tree

2 files changed

+11
-0
lines changed
  • jupyter-lib/api/src/main/kotlin/org/jetbrains/kotlinx/jupyter/util
  • src/test/kotlin/org/jetbrains/kotlinx/jupyter/test/repl

2 files changed

+11
-0
lines changed

jupyter-lib/api/src/main/kotlin/org/jetbrains/kotlinx/jupyter/util/reflecton.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ fun KClass<*>.isSubclassOfCatching(superType: KClass<*>): Boolean {
1111
false
1212
} catch (e: KotlinReflectionInternalError) {
1313
false
14+
} catch (e: InternalError) {
15+
// Workaround for #341
16+
false
1417
}
1518
}

src/test/kotlin/org/jetbrains/kotlinx/jupyter/test/repl/ReplTests.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,14 @@ class ReplTests : AbstractSingleReplTest() {
415415
(res as (Int) -> Int)(1) shouldBe 2
416416
}
417417

418+
@Test
419+
fun testAnonymousObjectRendering() {
420+
eval("42")
421+
eval("val sim = object : ArrayList<String>() {}")
422+
val res = eval("sim").resultValue
423+
res.toString() shouldBe "[]"
424+
}
425+
418426
@Test
419427
fun testOutVarRendering() {
420428
eval("Out").resultValue.shouldNotBeNull()

0 commit comments

Comments
 (0)