Skip to content

Commit

Permalink
Improve shape field access error message
Browse files Browse the repository at this point in the history
Summary: Previously we discussed "constant strings" which were being confused with class constants. Prefer "string literal" terminology.

Reviewed By: periodic1236

Differential Revision: D39044065

fbshipit-source-id: 20bf743f08137e97d9e14573735777cff03c8b9d
  • Loading branch information
Wilfred authored and facebook-github-bot committed Aug 26, 2022
1 parent d17aaaa commit c2b2433
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hphp/hack/src/errors/typing_error.ml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ module Primary = struct
let claim =
lazy
( pos,
"Was expecting a constant string, class constant, or int (for shape access)"
"Shape access requires a string literal, integer literal, or a class constant"
)
in
(Error_code.InvalidShapeFieldName, claim, lazy [], [])
Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/test/typecheck/shape_key_exists8.php.exp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
File "shape_key_exists8.php", line 6, characters 30-35:
Was expecting a constant string, class constant, or int (for shape access) (Typing[4051])
Shape access requires a string literal, integer literal, or a class constant (Typing[4051])
2 changes: 1 addition & 1 deletion hphp/hack/test/typecheck/shape_remove_key5.php.exp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
File "shape_remove_key5.php", line 13, characters 31-32:
Was expecting a constant string, class constant, or int (for shape access) (Typing[4051])
Shape access requires a string literal, integer literal, or a class constant (Typing[4051])

0 comments on commit c2b2433

Please sign in to comment.