smoke-tests: showcase invalid Dart behavior for constructors#1811
Draft
pwrobeldev wants to merge 4 commits into
Draft
smoke-tests: showcase invalid Dart behavior for constructors#1811pwrobeldev wants to merge 4 commits into
pwrobeldev wants to merge 4 commits into
Conversation
Scenario: a structure that does not define any explicit constructors and
does not have initialized fields. It has one internal field.
Expectation: the generated all-args ctor is internal.
Actual behavior: Java/Kotlin/Swift generates correct code.
Dart generates invalid code -- public ctor with internal field.
Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
Scenario: a structure that does not define any explicit constructors and
has a public initialized field. It has one additional internal field.
Expectation: the generated initialized-fields ctor is internal.
Actual behavior: Java/Kotlin/Swift generate correct code.
Dart generates invalid code -- public ctor with internal field.
Note: Dart must generate all-args-ctor (private) as well to all FFI->Dart conversion.
That part works correctly.
Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
Scenario: a structure that does not define any constructors and
has three public fields with default values assigned.
The fields are of structure type and default values invoke
overloaded field constructors.
Expectation: the generated default-values constructor properly
initializes fields and selects constructor overloads.
Actual behavior: Java/Kotlin/Swift support overloads and properly call
the constructor.
Dart generates invalid code -- overloads are not selected.
The code would not compile.
Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
pwrobeldev
force-pushed
the
pwrobeldev/showcase-invalid-dart-behavior
branch
from
July 22, 2026 06:13
689717a to
72f031a
Compare
…nternal
Scenario: A structure uses `PositionalDefaults` and does not define other constructors.
It has one public field with default value. One of fields is internal.
Expectation: Generated positional defaults constructor is not public.
It it was public it would expose internal field.
Actual behavior: Dart/Java/Kotlin generators produce wrong code. The constructor
is always public.
Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This draft MR will be used as test cases for the fix to show the missing requirements.