Hmm - thats interesting ( and surprising to me too)
NullReferenceException: Object reference not set to an instance of an object.
yes ?
I think thats still a bug - your workaround using explicit IList typing just switches the runtime to a different codepath that doesnt exhibit it...
I think theres some leakage between cobras notions of nilable and c#'s handling as implemented in the RT lib.
Adding null checks in Native.cs CobraImp.Equals(IList a, IList b) corrects for the surprise.
An equally valid ( and perhaps more cobra-ish) code workaround is to test for null with
- Code: Select all
ls = List<of int>?()
if ls
Console.writeLine("ok!")