Bug 58282 - [BlockSupport] Can't use Action <bool> in delegate
Summary: [BlockSupport] Can't use Action <bool> in delegate
Status: CONFIRMED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools (show other bugs)
Version: master
Hardware: PC Mac OS
: --- enhancement
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-07-20 20:31 UTC by Vincent Dondain [MSFT]
Modified: 2017-07-31 17:03 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 58282 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Vincent Dondain [MSFT] 2017-07-20 20:31:53 UTC
In our bindings we can't do:

delegate void UIContextualActionHandler (UIContextualAction action, UIView sourceView, [BlockCallback] Action<bool> completionHandler);

Here's the original signature:
typedef void (^UIContextualActionHandler)(UIContextualAction * _Nonnull, __kindof UIView * _Nonnull, void (^ _Nonnull)(BOOL));

Here's the build error and generated code that errors: https://gist.github.com/VincentDondain/bb5f25a36065a9e6fba0166fc378ffb1
Comment 1 Vincent Dondain [MSFT] 2017-07-20 20:53:36 UTC
Mmh so it looks like we have a case where:

for a signature of
`// -(void)performBatchUpdates:(void (^ _Nullable)(void))updates completion:(void (^ _Nullable)(BOOL))completion;`

we have `void PerformBatchUpdates (NSAction updates, [NullAllowed] UICompletionHandler completed);`

where `UICompletionHandler` is `delegate void UICompletionHandler (bool finished);`

------

so I maybe could do: `delegate void UIContextualActionHandler (UIContextualAction action, UIView sourceView, [BlockCallback] UIContextualActionCompletionHandler completionHandler);`

and `delegate void UIContextualActionCompletionHandler (bool finished);` ?
Comment 2 Alex Soto [MSFT] 2017-07-20 23:13:26 UTC
> so I maybe could do: `delegate void UIContextualActionHandler (UIContextualAction action, UIView sourceView, [BlockCallback] UIContextualActionCompletionHandler completionHandler);`
>
>and `delegate void UIContextualActionCompletionHandler (bool finished);` ?

Yes that should work and get you unblocked, but yeah I think we should also support Action<bool>