IDE: Fire
Version: 9.0.97.2071, 9.1.100.2076 (was originally discovered in 8.4 beta 2 month ago)
Target: Java
Description:
The following code compilation will fail with general Object reference not set to an instance of an object. (not sure how is the support for discriminated unions for now)
#if COOPER
import remobjects.elements.eunit
#else
import XCTest
#endif
enum Callback<T> {
case error(Error)
case success(T)
}
public class TestEnums: Test {
public func enumTests(){
let callback = Callback<String>.success("seems to be working")
switch callback {
case .error(let error): print("Callback with error: \(error)")
case .success(let result): print("Succesful callback: \(result)")
}
}
}