Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistakes in bottle-song example solution typespecs #1371

Closed
antoine-duchenet opened this issue Sep 20, 2023 · 3 comments
Closed

Mistakes in bottle-song example solution typespecs #1371

antoine-duchenet opened this issue Sep 20, 2023 · 3 comments

Comments

@antoine-duchenet
Copy link
Contributor

In the typespecs of .meta/example.ex, the arguments of quantifier/1 and bottle/1 should be non_neg_integer, not the current pos_integer, since it accepts 0 :

defmodule BottleSong do
  ...
  @spec quantifier(non_neg_integer) :: String.t()
  defp quantifier(n), do: Map.get(@quantifiers, n)

  @spec bottle(non_neg_integer) :: String.t()
  defp bottle(1), do: "bottle"
  defp bottle(_), do: "bottles"
end
@jiegillet
Copy link
Contributor

You're right, I missed this in the review. Do you want to open a PR?

@antoine-duchenet
Copy link
Contributor Author

antoine-duchenet commented Sep 22, 2023

Yes I will, I created this issue as a reminder 😄
You can assign me if you want !

@jiegillet
Copy link
Contributor

Solved by #1375

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

No branches or pull requests

2 participants