Java VerifyError comparing enum in generic field

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

Thanks, logged as bugs://75600

bugs://75600 got closed with status fixed.

Thanks very much!

Apparently this still fails with a Verify error in Fire 8.3.95.2031.
Running Tom’s attached test case gives:

!> Fatal exception on thread 0001 ()
!> Type: java.lang.VerifyError
!> Message: (class: mainproject/__Global, method: signature: ()V) Expecting to find object/array on stack

This was fixed for the beta, current betas do this fine.

So not 8.3? How far away is 8.4?

november.

Logged as bugs://i63564.

bugs://i63564 was closed as fixed.