forked from elixir-lang/elixir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dialyzer error when with else clause is calling a no_return funct…
…ion (elixir-lang#13659) Close elixir-lang#13656
- Loading branch information
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
lib/elixir/test/elixir/fixtures/dialyzer/with_no_return.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
defmodule Dialyzer.WithNoReturn do | ||
def with_no_return(list) do | ||
no_return = fn -> throw(:no_return) end | ||
|
||
with [] <- list do | ||
:ok | ||
else | ||
# note: throwing here directly wouldn't be caught in the first place, | ||
# calling a no_return function is what could cause an issue. | ||
_ -> no_return.() | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters