Test case failing on 8.3.93.1987: GenericBoxVerifyError.zip (333.6 KB)
public enum TestEnum
{
case Cabinet
case Stirfry
}
public class Frobber<T> {
public var value: T
public init(value: T) {
self.value = value
}
}
// VerifyError
// (but builds fine)
let x = Frobber<TestEnum>(value: TestEnum.Cabinet)
let isCabinet = (x.value == .Cabinet)
// Curiously, this alternative syntax both compiles and runs correctly
//let x = Frobber(value: TestEnum.Cabinet)
//let isCabinet = (x.value == TestEnum.Cabinet)
if isCabinet {
print("Cabinet")
} else {
print("Not cabinet")
}
Running it in this form produces this VerifyError:
$ java -cp . -jar mainproject.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.VerifyError: (class: mainproject/__Global, method: <clinit> signature: ()V) Expecting to find object/array on stack
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
If you replace it with the commented syntax it instead works correctly:
$ java -cp . -jar mainproject.jar
Cabinet