Bug 43995 - [generator] Add support for making types sealed
Summary: [generator] Add support for making types sealed
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools (show other bugs)
Version: master
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: (C10)
Assignee: Sebastien Pouliot
Depends on:
Reported: 2016-09-05 09:38 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2016-11-25 18:26 UTC (History)
2 users (show)

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


Description Rolf Bjarne Kvinge [MSFT] 2016-09-05 09:38:38 UTC
Some classes aren't meant to be subclassed (based on their documentation).

Example: RPScreenRecorder [1], there's a sharedInstance property that returns the only valid instance.

Making classes sealed also:

* Makes us able to generate less code for the bound methods (they don't have to be virtual, and can assume nobody will override them, so their implementation can be simpler)
* Makes the registrar able to just skip those types completely, no processing needed.

Unfortunately the generator completely ignores the [Sealed] attribute on types, it's only honored on methods.

[1] https://developer.apple.com/library/ios/documentation/ReplayKit/Reference/RPScreenRecorder_Ref/
Comment 1 Sebastien Pouliot 2016-11-23 08:34:37 UTC
PR https://github.com/xamarin/xamarin-macios/pull/1227

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