I’m running into a problem where apparently dyalizer doesn’t recognize a non-utc DateTime as a valid return. I’m simplifying my actual code a lot (if you want to see the full code, it’s here) but if I do, for example:
def shift_date(base_date) do
base_date
|> Timex.shift(days: 5)
|> Timex.set(hour: 5, minute: 5, second: 0)
end
Dialyzer is completely fine with it, but if I do:
def shift_date(base_date) do
base_date
|> Timex.shift(days: 5)
|> Timex.set(hour: 5, minute: 5, second: 0, timezone: "America/Sao_Paulo")
end
It says that the function has no local return. Does anyone know how to fix this?