8000 Fix #93 · codingwell/scala-guice@200d1e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 200d1e7

Browse files
committed
Fix #93
1 parent b2619ab commit 200d1e7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main/scala/net/codingwell/scalaguice/TypeConversions.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ private [scalaguice] object TypeConversions {
103103
val clazz = mirror.staticClass(owner.asClass.fullName)
104104
Some(mirror.runtimeClass(clazz))
105105
} else if (!owner.isPackage && owner.isClass) {
106-
Some(mirror.runtimeClass(owner.asClass))
106+
try {
107+
Some(mirror.runtimeClass(owner.asClass))
108+
} catch {
109+
case _:ClassNotFoundException => None
110+
}
107111
} else {
108112
None
109113
}

src/test/scala/net/codingwell/scalaguice/TypeLiteralSpec.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,9 @@ class TypeLiteralSpec extends FunSpec with Matchers {
137137
it("should handle anyval") {
138138
typeLiteral[LongAnyVal] shouldEqual new TypeLiteral[LongAnyVal] {}
139139
}
140+
141+
it("should handle deep nested static class") {
142+
typeLiteral[DeepInterface.Bar.Foo] shouldEqual new TypeLiteral[DeepInterface.Bar.Foo] {}
143+
}
140144
}
141145
}

0 commit comments

Comments
 (0)
0