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

Failed to lex warning: '<_@1 = \#{\'__struct__\':=\'Elixir.EventStore.Subscriptions.SubscriptionFsm\'}, _>' #192

Closed
OleMchls opened this issue Jun 14, 2018 · 5 comments

Comments

@OleMchls
Copy link

OleMchls commented Jun 14, 2018

Hey there,

Version 1 RC 0 looks great. I'm currently fighting tough dialyzer problem (I explained in detail here) was hoping to get insights with the new dialyzer but apparently, this stuff was too complex 😆

👌  eventstore git:(fix-typespecs) ✗ mix dialyzer
==> dialyxir
Compiling 55 files (.ex)
warning: function :struct_lexer.string/1 is undefined (module :struct_lexer is not available)
  lib/dialyxir/pretty_print.ex:4

warning: function :struct_parser.parse/1 is undefined (module :struct_parser is not available)
  lib/dialyxir/pretty_print.ex:14

Generated dialyxir app
==> eventstore
Compiling 48 files (.ex)
Generated eventstore app
Finding suitable PLTs
Checking PLT...
[:bunt, :compiler, :connection, :credo, :crypto, :db_connection, :decimal, :dialyxir, :dialyzer, :earmark, :elixir, :ex_doc, :file_system, :fsm, :gen_stage, :hipe, :inets, :kernel, :logger, :markdown, :mix, :mix_test_watch, :poison, :poolboy, :postgrex, :stdlib, :uuid, :wx]
Looking up modules in dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Finding applications for dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Finding modules for dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Checking 1556 modules in dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Adding 52 modules to dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Starting Dialyzer
[
  check_plt: false,
  init_plt: '/Users/ole/projects/eventstore/_build/dev/dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt',
  files_rec: ['/Users/ole/projects/eventstore/_build/dev/lib/eventstore/ebin'],
  warnings: [:unknown],
  format: nil,
  raw: nil
]
Total errors: 2, Skipped: 0
done in 2m5.53s
Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.

Failed to lex warning:
'<_@1 = \#{\'__struct__\':=\'Elixir.EventStore.Subscriptions.SubscriptionFsm\'}, _>'


Legacy warning:
lib/event_store/subscriptions/subscription_fsm.ex:7: The pattern <_@1 = #{'__struct__':='Elixir.EventStore.Subscriptions.SubscriptionFsm'}, _> can never match since previous clauses completely covered the type <#{'__struct__':='Elixir.EventStore.Subscriptions.SubscriptionFsm', 'data':=_, 'state':=_, _=>_},{'action_responses',[{_,_},...]}>
________________________________________________________________________________
lib/event_store/tasks/output.ex:24:no_return
Function do_raise/2 has no local return.
________________________________________________________________________________
done (warnings were emitted)

Thanks for working on this ❤️

@asummers
Copy link
Collaborator

Intriguing! I'll take a look at that lex error this evening.

@asummers
Copy link
Collaborator

Can you actually try with current master? I'm unable to reproduce this on master.

@OleMchls
Copy link
Author

@asummers I still encounter this with current master:

💀  eventstore git:(fix-typespecs) ✗ mix deps.update dialyxir
* Updating dialyxir (https://github.com/jeremyjh/dialyxir.git)
remote: Counting objects: 1785, done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 1785 (delta 59), reused 84 (delta 35), pack-reused 1657
Receiving objects: 100% (1785/1785), 327.61 KiB | 882.00 KiB/s, done.
Resolving deltas: 100% (907/907), done.
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  benchfella 0.3.5
  bunt 0.2.0
  connection 1.0.4
  credo 0.9.0
  db_connection 1.1.3
  decimal 1.5.0
  earmark 1.2.5
  ex_doc 0.18.3
  file_system 0.2.4
  fsm 0.3.0
  gen_stage 0.13.1
  mix_test_watch 0.6.0
  poison 3.1.0
  poolboy 1.5.1
  postgrex 0.13.5
  uuid 1.1.8
👌  eventstore git:(fix-typespecs) ✗ mix dialyzer
==> dialyxir
Compiling 1 file (.yrl)
src/struct_parser.yrl: Warning: conflicts: 27 shift/reduce, 0 reduce/reduce
Compiling 1 file (.xrl)
Compiling 2 files (.erl)
Compiling 55 files (.ex)
Generated dialyxir app
==> eventstore
Compiling 48 files (.ex)
Generated eventstore app
Finding suitable PLTs
Checking PLT...
[:bunt, :compiler, :connection, :credo, :crypto, :db_connection, :decimal, :dialyxir, :dialyzer, :earmark, :elixir, :ex_doc, :file_system, :fsm, :gen_stage, :hipe, :inets, :kernel, :logger, :markdown, :mix, :mix_test_watch, :poison, :poolboy, :postgrex, :stdlib, :uuid, :wx]
Looking up modules in dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Finding applications for dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Finding modules for dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Checking 1608 modules in dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Adding 2 modules to dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt
Starting Dialyzer
[
  check_plt: false,
  init_plt: '/Users/ole/projects/eventstore/_build/dev/dialyxir_erlang-20.3.7_elixir-1.6.5_deps-dev.plt',
  files_rec: ['/Users/ole/projects/eventstore/_build/dev/lib/eventstore/ebin'],
  warnings: [:unknown],
  format: nil,
  raw: nil
]
Total errors: 1, Skipped: 0
done in 2m3.33s
lib/event_store/subscriptions/subscription_fsm.ex:7:pattern_match_cov
The pattern
_ = %EventStore.Subscriptions.SubscriptionFsm{}, _

can never match since previous clauses completely cover the type

  %EventStore.Subscriptions.SubscriptionFsm{:data => _, :state => _, _ => _},
  {:action_responses, [{_, _}, ...]}
________________________________________________________________________________
done (warnings were emitted)

I don't know if it matters but I'm running a fork of the eventstore project: https://github.com/dnsimple/eventstore on the fix-typespecs branch

@OleMchls
Copy link
Author

@asummers OMFG. My bad, it does work on current master. NVM. I was just seeing the red :D

@asummers
Copy link
Collaborator

Yay! Glad to hear. Let me know if something else is funky.

@asummers asummers mentioned this issue Jun 14, 2018
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