Chromium Code Reviews
DescriptionNew Mojom parser: Don't allow enum variables to be assigned int values.
Thus far the new Mojom parser has allowed variables of enum type to be assigned integer values. This used to be allowed in .mojom files but that was changed a few months back and the new parser never picked up that change. This patch corrects that.
- Because IsAssignmentCompatible() now returns false in the case of assigning an int to an enum, it is necessary to not use IsAssignmentCompatible() in the case that a user-defined constant that resolves to an int is being used as an enum value initializer (because that is allowed). That explains the reorganization in UserValueRef.validateAfterResolution().
- We changed how assignments of literals to user-defined-types is handled. Previously we did some validation during parsing (for example we would check that the literal was not of type float) but left other validation for the later validation phase. We now due all validation during the later validation phase.
BUG=#46
R=azani@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/e27aa4fef1a5e79ca8caa433e86945f808452fa0
Patch Set 1 : working on stuff #
Messages
Total messages: 7 (4 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||