Bug 57795 - BindAs attribute for smart enum to multidimensional array generates code that doesn't compile
Summary: BindAs attribute for smart enum to multidimensional array generates code that...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools (show other bugs)
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Alex Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-06-27 14:52 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2017-11-02 15:23 UTC (History)
1 user (show)

See Also:
Tags:
Is this bug a regression?: No
Last known good build:


Attachments

Description Rolf Bjarne Kvinge [MSFT] 2017-06-27 14:52:52 UTC
Code:

	[BindAs (typeof (AVMediaTypes[,]))]
	[Export ("strongAVMediaTypesPropertiesMulti:")]
	NSString[,] StrongAVMediaTypesPropertiesMulti { get; set; }

results in compilation error:

	error CS0029: Cannot implicitly convert type 'AVFoundation.AVMediaTypes[]' to 'AVFoundation.AVMediaTypes[*,*]'
	error CS1929: 'AVMediaTypes[*,*]' does not contain a definition for 'GetConstant' and the best extension method overload 'UIContentSizeCategoryExtensions.GetConstant(UIContentSizeCategory)' requires a receiver of type 'UIContentSizeCategory'

I think the binding generator should just show an error in this case instead.
Comment 1 Alex Soto [MSFT] 2017-07-04 14:36:22 UTC
Yeah Agreed, Multidimensional arrays aren't supported in ObjC anyways
Comment 2 Alex Soto [MSFT] 2017-11-01 18:21:54 UTC
PR: https://github.com/xamarin/xamarin-macios/pull/2948
Comment 3 Alex Soto [MSFT] 2017-11-02 15:23:25 UTC
Fixed in xamarin-macios/master @ 8e92d2a350874c902195fb0ffaa80695799a18af

Note You need to log in before you can comment on or make changes to this bug.