-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add guarded function support, bump version
- Loading branch information
Showing
5 changed files
with
34 additions
and
3 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
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
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
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
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 |
---|---|---|
|
@@ -29,6 +29,24 @@ defmodule EfxCase.EfxExample do | |
string | ||
end | ||
|
||
# we use this to see if functions with guards | ||
# work properly at compile time | ||
@spec guarded_fun(any()) :: any() | ||
defeffect guarded_fun(a) when a in [:a, :b] do | ||
Check warning on line 35 in test/support/efx_example.ex GitHub Actions / Test on OTP 25.0.4 / Elixir 1.14.0
|
||
{a, :a_or_b} | ||
end | ||
|
||
@spec guarded_fun(any()) :: any() | ||
defeffect guarded_fun(a) do | ||
a | ||
end | ||
|
||
# we use this to see if one liners work without getting | ||
# deformed by formatter | ||
|
||
@spec one_liner(any()) :: any() | ||
defeffect one_liner(a), do: a | ||
Check warning on line 48 in test/support/efx_example.ex GitHub Actions / Test on OTP 25.0.4 / Elixir 1.14.0
|
||
|
||
@spec without_parens :: atom | ||
defeffect without_parens do | ||
:ok | ||
|