Skip to content
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

Generate getters for static final strings #825

Merged
merged 3 commits into from
Nov 27, 2023
Merged

Conversation

HosseinYousefi
Copy link
Member

Closes #792.

Strings with emojis behaved differently between POSIX and Windows and I failed to fix the summarizer in Windows, so I decided to revert the JFinalString changes and simply use a normal getter.

@@ -36,7 +36,8 @@ void registerTests(String groupName, TestRunnerCallback test) {
expect(Example.OFF, equals(0));
expect(Example.PI, closeTo(pi, fpDelta));
expect(Example.SEMICOLON, equals(';'.codeUnitAt(0)));
expect(Example.SEMICOLON_STRING, equals(';'));
expect(Example.SEMICOLON_STRING.toDartString(releaseOriginal: true),
equals(';'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an emoji as well in pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/simple_package/Example.java ?

@dcharkes
Copy link
Collaborator

Strings with emojis behaved differently between POSIX and Windows and I failed to fix the summarizer in Windows, so I decided to revert the JFinalString changes and simply use a normal getter.

Can we detect if we have emoji's? Should we consider having readable const strings in Dart for non-emoji strings? It is a better user experience if you can click to definition in Dart and see what the string is.

If it's not easy to detect, then lgtm.

@HosseinYousefi HosseinYousefi merged commit 0051e78 into main Nov 27, 2023
17 of 18 checks passed
@HosseinYousefi HosseinYousefi deleted the immutable-string branch November 27, 2023 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String escaping
2 participants