eproxus / meck

A mocking library for Erlang
http://eproxus.github.io/meck
Apache License 2.0
811 stars 231 forks source link

Crash when mocking Elixir 1.8-rc.0 compiled module #201

Closed lukaszsamson closed 5 years ago

lukaszsamson commented 5 years ago
{:compile_forms, {:error, [{[], [{:none, :compile, {:crash, :sys_core_fold, {{:case_clause, {:EXIT, {:function_clause, [{:sys_core_fold, :module, [[{:attribute, 1, :file, {'lib/simple.ex', 1}}, {:attribute, 1, :module, Simple_meck_original}, {:attribute, 1, :compile, [:no_auto_import]}, {:attribute, 1, :export, [__info__: 1, test: 0]}, {:attribute, 1, :spec, {{:__info__, 1}, [{:type, 1, :fun, [{:type, 1, :product, [{:type, ...}]}, {:type, 1, :any, []}]}]}}, {:function, 0, :__info__, 1, [{:clause, 0, [{:atom, 0, :module}], [], [{:atom, 0, Simple}]}, {:clause, 0, [{:atom, 0, :functions}], [], [{:cons, 0, {:tuple, ...}, {...}}]}, {:clause, 0, [{:atom, 0, :macros}], [], [nil: 0]}, {:clause, 0, [{:match, 0, {:var, ...}, {...}}], [], [{:call, 0, ...}]}, {:clause, 0, [{:match, 0, {...}, ...}], [], [{:call, ...}]}, {:clause, 0, [{:match, 0, ...}], [], [{...}]}, {:clause, 0, [{:atom, ...}], [], [...]}]}, {:function, 2, :test, 0, [{:clause, 2, [], [], [{:bin, 0, [{...}]}]}]}], [:binary, :return_errors, :debug_info, :dialyzer, :no_spawn_compiler_process, :from_core, :no_auto_import]], [file: 'sys_core_fold.erl', line: 109]}, {:compile, :"-select_passes/2-anonymous-2-", 3, [file: 'compile.erl', line: 585]}, {:compile, :"-internal_comp/5-anonymous-1-", 3, [file: 'compile.erl', line: 349]}, {:compile, :fold_comp, 4, [file: 'compile.erl', line: 376]}, {:compile, :internal_comp, 5, [file: 'compile.erl', line: 360]}, {:compile, :"-do_compile/2-anonymous-0-", 2, [file: 'compile.erl', line: 177]}, {:meck_code, :compile_and_load_forms, 2, [file: '/Users/lukaszsamson/mock/deps/meck/src/meck_code.erl', line: 71]}, {:meck_proc, :backup_original, 3, [file: '/Users/lukaszsamson/mock/deps/meck/src/meck_proc.erl', line: 363]}, {:meck_proc, :init, 1, [file: '/Users/lukaszsamson/mock/deps/meck/src/meck_proc.erl', line: 206]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}, [{:compile, :"-select_passes/2-anonymous-2-", 3, [file: 'compile.erl', line: 585]}, {:compile, :"-internal_comp/5-anonymous-1-", 3, [file: 'compile.erl', line: 349]}, {:compile, :fold_comp, 4, [file: 'compile.erl', line: 376]}, {:compile, :internal_comp, 5, [file: 'compile.erl', line: 360]}, {:compile, :"-do_compile/2-anonymous-0-", 2, [file: 'compile.erl', line: 177]}, {:meck_code, :compile_and_load_forms, 2, [file: '/Users/lukaszsamson/mock/deps/meck/src/meck_code.erl', line: 71]}, {:meck_proc, :backup_original, 3, [file: '/Users/lukaszsamson/mock/deps/meck/src/meck_proc.erl', line: 363]}, {:meck_proc, :init, 1, [file: '/Users/lukaszsamson/mock/deps/meck/src/meck_proc.erl', line: 206]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}]}], []}}

Reproduction Steps

  1. clone https://github.com/jjh42/mock
  2. install Elixir 1.8.-rc.0
  3. run tests 'mix test'

Versions

eproxus commented 5 years ago

Fixed in 0.8.13