[swift2objc] Support optional primitives #1743
Labels
good first issue
A good starting issue for contributors (issues with this label will appear in /contribute)
package:swift2objc
Milestone
Optional object types are straightforward to support, because they map to nullable object pointers in ObjC. But for optional primitive types like
Int?
, there's no ObjC equivalent. So the swift compiler will raise an error if you try to annotate an entity involvingInt?
with@objc
.The straightforward solution is to box the
Int
in an object.Dart does support
int?
, so ideally we'd also unbox it on the Dart side. To do this we'd need to special case the box type in ffigen.The text was updated successfully, but these errors were encountered: