-
Notifications
You must be signed in to change notification settings - Fork 548
Open
Labels
enhancementThe issue or pull request is an enhancementThe issue or pull request is an enhancementgeneratorIssues affecting the generatorIssues affecting the generatorhelp wantedThis is an issue or pull request where we request help from the community to fix or completeThis is an issue or pull request where we request help from the community to fix or completeiOSIssues affecting iOSIssues affecting iOSmacOSIssues affecting macOSIssues affecting macOS
Milestone
Description
Sometimes Apple provides an immutable class and a mutable subclass. Example: AVMetadataItem and AVMutableMetadataItem. If a developer creates an instance of an AVMetadataItem and tries to set a property, a NotImplementedException will be thrown:
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public virtual NSString? MetadataIdentifier {
[Export ("identifier")]
get {
...
}
[NotImplemented ()]
set {
throw new NotImplementedException ();
}
}This is confusing for developers, every now and then we get bug reports about it:
Idea: change the generated code to throw something else with a better description:
[BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
public virtual NSString? MetadataIdentifier {
[Export ("identifier")]
get {
...
}
[NotImplemented ()]
set {
throw new NotSupportedException ("This member is read-only. Use an instance of the mutable subclass AVMutableMetadataItem instead.");
}
}spouliot
Metadata
Metadata
Assignees
Labels
enhancementThe issue or pull request is an enhancementThe issue or pull request is an enhancementgeneratorIssues affecting the generatorIssues affecting the generatorhelp wantedThis is an issue or pull request where we request help from the community to fix or completeThis is an issue or pull request where we request help from the community to fix or completeiOSIssues affecting iOSIssues affecting iOSmacOSIssues affecting macOSIssues affecting macOS