Generate type aliases in Dart#1764
Merged
Merged
Conversation
This change introduces generation of type aliases for Dart. Updated other Dart templates and resolvers to treat type aliases as a normal type, instead of skipping it through to the target type. This commit is just a rebase of another pull request. Original author: Daniel Kamkha <daniel.kamkha@here.com> Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
The expected output is adjusted because now typedefs are generated and used by their names instead resolving full qualified names of types. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This change introduces a new test suite for Dart. This commit is just a rebase of another pull request. Original author: Daniel Kamkha <daniel.kamkha@here.com> Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This change introduces new expected output files for Dart to showcase that global typedefs work as expected. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
Contributor
Author
|
This MR is rebase of: #1163 |
Hsilgos
previously approved these changes
Jun 11, 2025
When typealias is declared in an internal class or is internal, then the generated code does not compile. This commit showcases the bug in smoke and functional tests. The compilation fails. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
The name of internal typealias does not need to be prepended by underscore. We do not export internal typealias from our library. Therefore, it cannot be used outside. This commit aligns the behavior with handling of internal classes. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
The file, which contains only a global typedef does not need to include conversion imports. They cause unused imports warning. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This commit shows that conversion headers are included for typealiases usage -- in such cases conversion headers are needed. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
Hsilgos
approved these changes
Jun 12, 2025
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.
Added dedicated DartTypeAlias template, as type aliases (typedefs) are now
supported in Dart language (since Dart version 2.13). Updated other Dart
tempates and resolvers to treat type aliases as a normal type, instead of
skipping it through to the target type.
Added/updated related smoke and functional tests.
Unrelated smoke tests are updated in a separate commit.
Resolves: #907
This MR is a rebase of an old draft created by Daniel + new logic for
handling of typedefs declared in internal types + more tests.
Co-author: Daniel Kamkha daniel.kamkha@here.com