Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Unified Diff: mojom/mojom_parser/mojom/user_defined_types.go

Issue 1514173002: New Mojom parser: Don't allow enum variables to be assigned int values. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: working on stuff Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/mojom/types_test.go ('k') | mojom/mojom_parser/mojom/user_defined_types_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/mojom/user_defined_types.go
diff --git a/mojom/mojom_parser/mojom/user_defined_types.go b/mojom/mojom_parser/mojom/user_defined_types.go
index c701e01f06b9a85638c9745b75cda712102268e3..1bacd006c7ba5aff2040b166bbda2f18ed0f79f2 100644
--- a/mojom/mojom_parser/mojom/user_defined_types.go
+++ b/mojom/mojom_parser/mojom/user_defined_types.go
@@ -504,17 +504,6 @@ func (MojomEnum) ConcreteTypeKind() TypeKind {
}
func (e MojomEnum) IsAssignmentCompatibleWith(value LiteralValue) bool {
- if value.IsDefault() {
- return true
- }
- t := value.LiteralValueType()
- if t == SimpleTypeInt8 || t == SimpleTypeInt16 || t == SimpleTypeInt32 || t == SimpleTypeInt64 {
- // TODO(rudominer) Finish MojomEnum.IsAssignmentCompatibleWith()
- // We should check that the value is in the range of the enum fields.
- // Do we want to deprecate the ability to assign an integer to an
- // enum varialbe?
- return true
- }
return false
}
« no previous file with comments | « mojom/mojom_parser/mojom/types_test.go ('k') | mojom/mojom_parser/mojom/user_defined_types_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698