Skip to content

Commit

Permalink
Clarify map type approximation in errors
Browse files Browse the repository at this point in the history
Summary: Add a clarification that a map type will be approximated to `#{dynamic() => dynamic()}` in `bad_map_key` errors.

Reviewed By: ilya-klyuchnikov

Differential Revision: D65278382

fbshipit-source-id: 74cb9e7eeaa8b1184c845c2eab4c10cd3161ff01
  • Loading branch information
VLanvin authored and facebook-github-bot committed Nov 1, 2024
1 parent a2bd690 commit 83b07ae
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ object InvalidDiagnostics {
}
case class BadMapKey(pos: Pos, required: Boolean) extends Invalid {
val msg: String = {
if (required) {
s"Required map key should always be composed of statically defined atoms or tuples."
} else {
s"Only one default association per map is allowed, all other keys should be composed of statically defined atoms or tuples."
val reason: String = {
if (required) {
s"Required map key should always be composed of statically defined atoms or tuples."
} else {
s"Only one default association per map is allowed, all other keys should be composed of statically defined atoms or tuples."
}
}
s"Map type will be approximated to #{dynamic() => dynamic()}, suppressing potential errors.\n${reason}"
}
def errorName = "bad_map_key"
}
Expand Down

0 comments on commit 83b07ae

Please sign in to comment.