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
Compiling 207 files (.ex)
warning: this clause cannot match because a previous clause at line 29 always matches
│
35 │ def from_avro_map(%{} = invalid) do
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
│
└─ lib/generated/foo.ex:35
The warning raises from the following generated code:
@impl true
def from_avro_map(%{} = avro_map) do
value = avro_map["value"] || "Unknown"
{:ok, %__MODULE__{value: decode_value(value)}}
end
@required_keys MapSet.new([])
def from_avro_map(%{} = invalid) do
actual = Map.keys(invalid) |> MapSet.new()
missing = MapSet.difference(@required_keys, actual) |> Enum.join(", ")
{:error, "Missing keys: " <> missing}
end
def from_avro_map(_) do
{:error, "Expected a map."}
end
The second definition of from_avro_map should be probably omitted in this scenario.
The text was updated successfully, but these errors were encountered:
The following schema
generates the following warning
The warning raises from the following generated code:
The second definition of
from_avro_map
should be probably omitted in this scenario.The text was updated successfully, but these errors were encountered: