Skip to content

Fix type errors discovered by 1.20 - #23

Merged
NeilMenne merged 1 commit into
masterfrom
fix/type-warnings
Jun 17, 2026
Merged

NeilMenne merged 1 commit into
masterfrom
fix/type-warnings

Conversation

@keathley

@keathley keathley commented Jun 7, 2026 •

Copy link
Copy Markdown
Member

I noticed these errors after updating my companies app to elixir 1.20. The main change is in from_string/1. Our tests were passing by accident. After reviewing it the old code, I didn't think the with was providing value. In reality it was likely making errors cases harder to understand. So, to make the errors more obvious I opted to raise an explicit ArgumentError if this function fails. This felt like the right call to make because we're returning Timestamp.t() and not {:ok, Timestamp.t()}, and because its really unlikely that anyone will call this function with anything other than a stringified Timestamp. But, its probably debatable. If other people feel strongly I can re-work this code.

@NeilMenne NeilMenne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind the behavior change. We'll get this out. Thanks for finding/fixing!

@NeilMenne
NeilMenne merged commit 0476d93 into master Jun 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants