-
Notifications
You must be signed in to change notification settings - Fork 91
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
RDART-992: Const initializer evaluation is too simple #1607
Conversation
Pull Request Test Coverage Report for Build 8471153652Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a minor suggestion on my end.
if (initExpression is Literal) return true; | ||
if (initExpression is InstanceCreationExpression) return initExpression.isConst; | ||
if (initExpression is PrefixExpression) return _isValidFieldInitializer(initExpression.operand); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rewrite this with a switch expression? I'm not a huge fan of series of 1-line ifs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good fix 👍
packages/realm_generator/test/good_test_data/const_initializer.dart
Outdated
Show resolved
Hide resolved
* main: RDART-996: Don't serialize backlinks (#1617) Update README.md (#1608) RDART-983: Refactor how we open dynamic library to give better error message (#1614) RDART-991: Rename Key enum (#1613) RDART-992: Handle Identifer expression as well (#1612) Add workflow_dispatch for development Common setup script (#1610) RDART-992: Const initializer evaluation is too simple (#1607) # Conflicts: # CHANGELOG.md
Fix #1606