Skip to content

Commit c2b2433

Browse files
Wilfredfacebook-github-bot
authored andcommitted
Improve shape field access error message
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
1 parent d17aaaa commit c2b2433

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

hphp/hack/src/errors/typing_error.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ module Primary = struct
391391
let claim =
392392
lazy
393393
( pos,
394-
"Was expecting a constant string, class constant, or int (for shape access)"
394+
"Shape access requires a string literal, integer literal, or a class constant"
395395
)
396396
in
397397
(Error_code.InvalidShapeFieldName, claim, lazy [], [])
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
File "shape_key_exists8.php", line 6, characters 30-35:
2-
Was expecting a constant string, class constant, or int (for shape access) (Typing[4051])
2+
Shape access requires a string literal, integer literal, or a class constant (Typing[4051])
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
File "shape_remove_key5.php", line 13, characters 31-32:
2-
Was expecting a constant string, class constant, or int (for shape access) (Typing[4051])
2+
Shape access requires a string literal, integer literal, or a class constant (Typing[4051])

0 commit comments

Comments
 (0)