gjaldon / ecto_enum

Ecto extension to support enums in models
MIT License
562 stars 131 forks source link

Warning while compile project #81

Closed msudgh closed 5 years ago

msudgh commented 5 years ago

I've declared two Enum in my repository but while compile and start Phoenix i got these warnings, what could be wrong?

defenum PatronTypeEnum, ["admin", "cs", "owner"]
defenum PatronStatusEnum, ["disable", "enabled", "kicked"]

warning: this clause cannot match because a previous clause at line 2 always matches
  lib/blinder_api/repository/patrons/patron.ex:2

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/blinder_api/repository/patrons/patron.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/blinder_api/repository/patrons/patron.ex:3

warning: this clause cannot match because a previous clause at line 3 always matches
  lib/blinder_api/repository/patrons/patron.ex:3
gjaldon commented 5 years ago

@msudgh I'm not sure if that's a bug in EctoEnum or in Elixir. Do both types PatronTypeEnum and PatronStatusEnum work as intended?

msudgh commented 5 years ago

@gjaldon everything work as well but I'm wondering about the root cause of these warnings.

gjaldon commented 5 years ago

@msudgh unfortunately, I was yet unable to pin down the cause. It may be a bug in Elixir.

msudgh commented 5 years ago

@gjaldon What's your elixir and ecto version? I'm using elixir 1.8.2, phoenix_ecto 4.0 and ecto_sql 3.0

gjaldon commented 5 years ago

I'm using elixir 1.9.0.

On Mon, Jul 1, 2019 at 10:00 AM Masoud Ghorbani notifications@github.com wrote:

@gjaldon https://github.com/gjaldon What's your elixir and ecto version? I'm using elixir 1.8.2, phoenix_ecto 4.0 and ecto_sql 3.0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gjaldon/ecto_enum/issues/81?email_source=notifications&email_token=AALD4QXC4SW7NGWXN5ABIJDP5GTQZA5CNFSM4H4MVBJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY5F2FA#issuecomment-507141396, or mute the thread https://github.com/notifications/unsubscribe-auth/AALD4QXIN77VTIYKVWV24GTP5GTQZANCNFSM4H4MVBJQ .

-- Kind regards, Gabriel Jaldon

gjaldon commented 5 years ago

Just published version 1.3.1