-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve diagnostics for initializers
Summary: * Improve remaining diagnostic messages mentioning value, type and the name of the innermost named entity as we do in other cases. * Remove "custom default" from the diagnostic messages since it doesn't make sense for consts. * Simplify initializer checks for primitive types. * Fix `double` initializer test which incorrectly used `float` instead of `double`. * Remove duplicate tests. * Add a few more tests. The following example illustrates diagnostic improvement. Thrift: ``` const i32 big = 2147483648; ``` Before: ``` [ERROR:test.thrift:1] value error: const `big` has an invalid custom default value. ``` After: ``` [ERROR:test.thrift:1] 2147483648 is out of range for `i32` in initialization of `big` ``` Reviewed By: avalonalex Differential Revision: D61730467 fbshipit-source-id: 4b34e8f73ec28184f10477ef113ea34a4b212269
- Loading branch information
1 parent
500c52d
commit 88ec5c7
Showing
3 changed files
with
106 additions
and
227 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.