Open
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.");
}
}