Embeddinator-4000 icon indicating copy to clipboard operation
Embeddinator-4000 copied to clipboard

[ObjC] Improve error when binding contains non-simple not-exported types (such as BCL)

Open shobhakartiwari opened this issue 8 years ago • 3 comments

error EM0009: The feature Returning type TextReader from native code is not currently supported by the tool

shobhakartiwari avatar Sep 13 '17 15:09 shobhakartiwari

This appears to be the general "we don't support things that don't match a pattern we've listed" error:

https://github.com/mono/Embeddinator-4000/blob/master/objcgen/objcgenerator.cs#L1225

chamons avatar Mar 19 '18 20:03 chamons

After doing some poking, I've verified this is the general "we only support limited return/param types" with classes with export. The HasClass \ HasProtocol check above is what we're failing.

This hits us if we try to use a Stream, or a other BCL types.

One could imagine even if this works, how would you use that TextReader, unless we also exposed every single method on it to ObjC as well.

I would suggest changing your API to return an object that contains the TextReader internally and exposes whatever items you need in simpler terms.

chamons avatar Mar 20 '18 16:03 chamons

I'm going to convert this issue into a "we should drastically improve the error message".

chamons avatar Mar 20 '18 16:03 chamons