just updated to swift3 and Fire 2151… (for an iOS android project)
after all my code looks like it’s compiled in Fire I get this
/Applications/Fire.app/Contents/Resources/XbuildTargets/RemObjects Software/Elements/RemObjects.Elements.Cooper.Common.targets: error : Object reference not set to an instance of an object at RemObjects.Oxygene.Code.Compiler.Compiler.m () [0x00266] in :0
at RemObjects.Oxygene.MSBuild.OxygeneCompiler.Execute () [0x00818] in :0
unfortunately since I just converted about 90K lines, I don’t know which one is causing the problem
Hmm, that looks like a compiler bug. Can you send us the project in question, and.or post the full (“Diagnostic”) build log? If you have beta access, could you also try the latest beta/gamma instead of .2151?
unfortunately IP restrictions mean I can’t send you the project. If I can narrow it down I can send you a fragment.
I don’t have beta access… but I would like to. How do I get that? (I used to have it at asdeq labs.)
The full log might help in the mean time. Betas are avaiable to all paid customers at http://beta.remobjects.com, but i can otherwise send you the latest beta tomorrow — what’s your remobjects.com account name?
Entering phase “Generating Output” (00:00:00.1392744)
/Applications/Fire.2151.app/Contents/Resources/XbuildTargets/RemObjects Software/Elements/RemObjects.Elements.Cooper.Common.targets: error : Object reference not set to an instance of an object at RemObjects.Oxygene.Code.Compiler.Compiler.m () [0x00266] in :0
at RemObjects.Oxygene.MSBuild.OxygeneCompiler.Execute () [0x00818] in :0
Task “OxygeneCompiler” execution – FAILED
class X
{
var a: Int?
var b: Int?
}
var a: Int? = 1
var b: Int? = 2
func f()
{
// crash
//let c = a ?? b
//crash
//var c = a ?? b
//crash
//let x = X()
//let c = x.a ?? x.b
//crash
//let x: X? = X()
//var c = x?.a
//c = c ?? x?.b
// OK
//var c = a
//if c == nil { c = b }
//crash
//let c: Int? = a ?? b
// OK
let c = a ?? b ?? 0
}
so here is the outcome of some research…
basically it appears that if the rhs (final outcome) of a ?? is optional there is a problem.
class X
{
var a: Int?
var b: Int?
}
var a: Int? = 1
var b: Int? = 2
func f()
{
// crash
let c1 = a ?? b
//crash
var c2 = a ?? b
//crash
let x = X()
let c3 = x.a ?? x.b
//crash
let x2: X? = X()
var c4 = x2?.a
c4 = c4 ?? x2?.b
// OK
var c5 = a
if c5 == nil { c5 = b }
//crash
let c6: Int? = a ?? b
// OK
let c7 = a ?? b ?? 0
}
f()
as iOS, OSX and .NET app; neither seems to crash the compiler, so I must be missing a step. or it’s something we already fixed since. Just in case, can you send me the test project above as -is that crashes?
public override func onCreate(_ savedInstanceState: Bundle!) {
super.onCreate(savedInstanceState)
ContentView = R.layout.main
let a: Int? = nil
let b: Int? = nil
let c = a ?? b
}