fix(dart): hide internal fields in ctor#1809
Conversation
Signed-off-by: Iwo Sidorowicz <294463459+isidorowiczdev@users.noreply.github.com>
|
As discussed offline -- besides the problem with Please have a look at the following input from our smoke tests: And the corresponding output for Dart: In the output file you can see that |
|
Hide whole constructor because of one field? |
| !useDefaultsConstructor -> "" | ||
| noFieldsConstructor == null -> | ||
| if (DartGeneratorPredicates.allFieldsCtorIsPublic(actualType)) ".withDefaults" else "" | ||
| if (DartGeneratorPredicates.allFieldsCtorIsPublic(actualType)) ".withDefaults" else "._withDefaults" |
There was a problem hiding this comment.
Unfortunately, this breaks the functional tests. They do not compile. We need to analyze the logic of generation constructors, because the fix may not be trivial.
@Hsilgos -- is the proposal to filter the internal field from the constructor's parameters list? If that's the proposal, then I have one question:
If I understand correctly, if we filtered such field from the constructor then it would be uninitialized. |
…nal fields Signed-off-by: Iwo Sidorowicz <294463459+isidorowiczdev@users.noreply.github.com>
Fix Dart generator so internal fields stay out of public all-args constructor. Reason: current generator leaks @internal field into public API, unlike Java, and smoke tests show broken output.