You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: Unknown record field
┌─ /src/goto.gleam:12:20
│
12 │ io.debug(response.body)
│ ^^^^^ This field does not exist
The value being accessed has this type:
Result(Response(String), Dynamic)
It does not have any fields.
It would be extra nice if the compiler could see that .body is a valid field access for the type wrapped in the Ok variant and suggest how to fix the problem:
error: Unknown record field
┌─ /src/goto.gleam:12:20
│
12 │ io.debug(response.body)
│ ^^^^^ This field does not exist
The value being accessed has this type:
Result(Response(String), Dynamic)
It does not have any fields.
Hint: if you want to access the `.body` field of a `Response` you
should first pattern match on the `Result`
case response {
Ok(response) -> io.debug(response.body)
Error(_) -> todo as "deal with error case"
}
It would also be nice to have a code action to fix this automatically
The text was updated successfully, but these errors were encountered:
In this code snippet:
I get the following error:
error: Unknown record field ┌─ /src/goto.gleam:12:20 │ 12 │ io.debug(response.body) │ ^^^^^ This field does not exist The value being accessed has this type: Result(Response(String), Dynamic) It does not have any fields.
It would be extra nice if the compiler could see that
.body
is a valid field access for the type wrapped in theOk
variant and suggest how to fix the problem:error: Unknown record field ┌─ /src/goto.gleam:12:20 │ 12 │ io.debug(response.body) │ ^^^^^ This field does not exist The value being accessed has this type: Result(Response(String), Dynamic) It does not have any fields. Hint: if you want to access the `.body` field of a `Response` you should first pattern match on the `Result` case response { Ok(response) -> io.debug(response.body) Error(_) -> todo as "deal with error case" }
It would also be nice to have a code action to fix this automatically
The text was updated successfully, but these errors were encountered: