We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cbc15e commit 2c349c1Copy full SHA for 2c349c1
compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala
@@ -200,6 +200,28 @@ class DottyBytecodeTests extends DottyBytecodeTest {
200
}
201
202
203
+ @Test def switchOnUnionOfChars = {
204
+ val source =
205
+ """
206
+ |object Foo {
207
+ | def foo(ch: 'a' | 'b' | 'c' | 'd' | 'e'): Int = ch match {
208
+ | case 'a' => 1
209
+ | case 'b' => 2
210
+ | case 'c' => 3
211
+ | case 'd' => 4
212
+ | case 'e' => 5
213
+ | }
214
+ |}
215
+ """.stripMargin
216
+
217
+ checkBCode(source) { dir =>
218
+ val moduleIn = dir.lookupName("Foo$.class", directory = false)
219
+ val moduleNode = loadClassNode(moduleIn.input)
220
+ val methodNode = getMethod(moduleNode, "foo")
221
+ assert(verifySwitch(methodNode))
222
+ }
223
224
225
@Test def switchOnUnionOfIntSingletons = {
226
val source =
227
"""
0 commit comments