Skip to content

Commit

Permalink
Fix spec for display_name/2. Closes #43
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Apr 10, 2024
1 parent b53f859 commit 99d88a3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## Cldr_Units v3.16.5

This is the changelog for Cldr_units v3.16.4 released on April 11th, 2024. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_units/tags)

### Bug Fixes

* Fix spec for `Cldr.Unit.display_name/2`. Thanks to @ryotsu for the report. Closes #43.

## Cldr_Units v3.16.4

This is the changelog for Cldr_units v3.16.4 released on November 2nd, 2023. For older changelogs please consult the release tag on [GitHub](https://github.com/elixir-cldr/cldr_units/tags)
Expand Down
2 changes: 1 addition & 1 deletion lib/cldr/unit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ defmodule Cldr.Unit do
"l"
"""
@spec display_name(Cldr.Unit.value() | Cldr.Unit.t(), Keyword.t()) ::
@spec display_name(translatable_unit() | t(), Keyword.t()) ::
String.t() | {:error, {module, binary}}

def display_name(unit, options \\ [])
Expand Down
2 changes: 1 addition & 1 deletion lib/cldr/unit/backend.ex
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ defmodule Cldr.Unit.Backend do
"l"
"""
@spec display_name(Cldr.Unit.value() | Cldr.Unit.t(), Keyword.t()) ::
@spec display_name(Cldr.Unit.translatable_unit() | Cldr.Unit.t(), Keyword.t()) ::
String.t() | {:error, {module, binary}}

def display_name(unit, options \\ []) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Cldr.Units.Mixfile do
use Mix.Project

@version "3.16.4"
@version "3.16.5"

def project do
[
Expand Down
9 changes: 9 additions & 0 deletions mix/for_dialyzer.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defmodule Cldr.Unit.Dialyzer do
def display_name do
MyApp.Cldr.Unit.display_name(:kilogram)
MyApp.Cldr.Unit.display_name(Cldr.Unit.new!(:foot, 1))

Cldr.Unit.display_name(:kilogram, backend: MyApp.Cldr)
Cldr.Unit.display_name(Cldr.Unit.new!(:foot, 1), backend: MyApp.Cldr)
end
end

0 comments on commit 99d88a3

Please sign in to comment.