-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Make it possible to implement ResourceIdentifier
#55568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah, there's the issue. Can you even do: const myResource = ResourceIdentifier(...);
@myResource
Some declaration... ? |
Yes, the current check is name and library only. I like the idea of subclassing! |
I think we should likely disallow implementing, because the Also, we should specify what happens to subclasses specifying more fields. Are they reported in the class JClassIdentifier extends ResourceIdentifier {
final String name;
const JClassIdentifier(this.name)
: super('jnigen');
} This would currently lead to a class between @mosuem @HosseinYousefi @lrhn Any preferences on if the |
@lrhn class JClassIdentifier extends ResourceIdentifier {
const JClassIdentifier(String name, String somethingElse)
: super(const {name: somethingElse}); // Error!
} I assume it's because the const string and string have the same syntax but const map requires an extra class JClassIdentifier extends ResourceIdentifier {
const JClassIdentifier(String name, String somethingElse)
: super(preferConst {name: somethingElse});
} Since making |
Since we can't quite fill the metadata as a map using the arguments of the subclass' const constructor, I prefer it if we report all fields if possible. |
We intend to make The |
ResourceIdentifier
ResourceIdentifier
The code for replacing interface class RecordReference {
// ignore: unused_field, this field will be recorded by the SDK.
final Object? _metadata;
const RecordReference([Object? metadata]) : this._metadata = metadata;
} |
ResourceIdentifier
is currently not afinal
class. However, it won't behave correctly if we subclass it, and use the subclass as an annotation, since we're checking it based on the name.I would like to be able to implement it for jnigen, so I don't have to repeat certain things in the generated code. For example:
@mosuem
cc/ @dcharkes
The text was updated successfully, but these errors were encountered: