You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some modifications may be applied to the generated dart, i.e. add a method. Meanwhile dart file should be updated by re-generate using cli, whenever java file gets updated.
Adding a method each re-generation could be avoided by using external and @patch, but @patch is private to dart:_internal.
On external and @patch only, a keyword can only be used with a private meta looks quite strange to me.
The text was updated successfully, but these errors were encountered:
The syntax external is generally available so that any Dart source tool can handle partially specified declarations. There is no inherent meaning to the marker except that the meaning of the function is supplied in a non-source based way, which obviously means that a compiler needs to know what to do with it.
Currently it's only used by the platform libraries because that's the only external functions that the platform compilers know how to provide an implementation for.
The @patch marker and patch files is not public. It's just how the SDK developers have agreed to structure our implementations, and it's not designed to be a public-facing feature (it's cumbersome, pedantic and fragile, but that only affects a few people, so it's OK in the grand scale of things).
If you look at the dart:ffi library, that's another place where a compiler introduces implementation from a non-source-code source. It should probably be using external markers on its fields (which is why we consider allowing external fields now (#44), something which was previously not needed because a few internal people cumbersomely having to write individual getters and setters was considered OK).
So: Definite no to exposing @patch because we do not want to expose the patching operation to user code. You might want something like partial classes (#678).
I have a cli command to convert gson java file to dart file. i.e.
to
Some modifications may be applied to the generated dart, i.e. add a method. Meanwhile dart file should be updated by re-generate using cli, whenever java file gets updated.
Adding a method each re-generation could be avoided by using external and @patch, but @patch is private to dart:_internal.
On external and @patch only, a keyword can only be used with a private meta looks quite strange to me.
The text was updated successfully, but these errors were encountered: