From 0f7069d02e99ea12300caac84a790bddf1fe2c51 Mon Sep 17 00:00:00 2001 From: Victor Lanvin Date: Tue, 9 Dec 2025 06:29:17 -0800 Subject: [PATCH] Deprecate old error messages Summary: As title. Remove the "detailed message" part, which is too verbose and mostly useless now. Reviewed By: TD5 Differential Revision: D88633277 fbshipit-source-id: 092691c2520983148fa0ef8d61a62bd1149a1231 --- .../eqwalizer_tests/check/any_fun_type.pretty | 26 - .../test/eqwalizer_tests/check/approx.pretty | 6 - .../eqwalizer_tests/check/auto_imports.pretty | 9 +- .../eqwalizer_tests/check/booleans.pretty | 6 - .../check/case_predicates.pretty | 19 - .../eqwalizer_tests/check/complex_maps.pretty | 76 -- .../check/comprehensions.pretty | 44 -- .../check/contravariant.pretty | 10 - .../check/custom-OTP-27.pretty | 746 +----------------- .../check/dynamic_calls.pretty | 48 +- .../check/dynamic_catch.pretty | 6 - .../eqwalizer_tests/check/dynamic_fun.pretty | 30 - .../check/dynamic_generics.pretty | 32 - .../check/dynamic_local_funs.pretty | 6 - .../check/dynamic_refine.pretty | 23 - .../eqwalizer_tests/check/elab_clause.pretty | 12 - .../check/error_messages.pretty | 67 +- .../test/eqwalizer_tests/check/format.pretty | 6 - .../test/eqwalizer_tests/check/funs.pretty | 74 -- .../test/eqwalizer_tests/check/funs2.pretty | 30 - .../check/generic_fun_application.pretty | 231 ------ .../check/generics_with_unions.pretty | 57 -- .../check/gradual_bounded.pretty | 28 - .../check/gradual_complex_types.pretty | 25 - .../check/gradual_custom.pretty | 74 -- .../check/gradual_maybe.pretty | 8 - .../eqwalizer_tests/check/gradual_misc.pretty | 17 +- .../check/guard_b_connections.pretty | 40 - .../eqwalizer_tests/check/guards_logic.pretty | 15 - .../test/eqwalizer_tests/check/hints.pretty | 12 - .../test/eqwalizer_tests/check/iolists.pretty | 16 - .../eqwalizer_tests/check/lists_tests.pretty | 20 - .../test/eqwalizer_tests/check/misc.pretty | 128 +-- .../test/eqwalizer_tests/check/neg.pretty | 7 - .../test/eqwalizer_tests/check/numbers.pretty | 13 - .../test/eqwalizer_tests/check/opaque.pretty | 32 - .../test/eqwalizer_tests/check/other.pretty | 6 - .../test/eqwalizer_tests/check/otp28.pretty | 45 -- .../eqwalizer_tests/check/otp_opaques.pretty | 33 - .../eqwalizer_tests/check/overloaded.pretty | 30 +- .../check/overloaded_specs_union.pretty | 14 - .../test/eqwalizer_tests/check/pats.pretty | 6 - .../test/eqwalizer_tests/check/records.pretty | 119 +-- .../check/recursive_aliases.pretty | 71 -- .../test/eqwalizer_tests/check/refine.pretty | 120 --- .../check/strict_complex_types.pretty | 18 - .../eqwalizer_tests/check/subtype_neg.pretty | 96 --- .../test/eqwalizer_tests/check/t_maps.pretty | 278 ------- .../test/eqwalizer_tests/check/tries.pretty | 6 - .../eqwalizer_tests/check/tuple_union.pretty | 21 - .../eqwalizer_tests/check/type_asserts.pretty | 57 -- .../check/use_dynamic_gradual.pretty | 7 - .../check/use_dynamic_strict.pretty | 7 - .../eqwalizer_tests/eqwater/eqwater.pretty | 158 +--- .../eqwater/eqwater_lists.pretty | 38 - .../eqwater/eqwater_maps.pretty | 18 - .../eqwater/eqwater_records.pretty | 42 - .../eqwater/eqwater_sound.pretty | 16 - .../eqwater/unlimited_refinement.pretty | 6 - .../fault_tolerance/fault_tolerance.pretty | 12 - .../eqwalize_all_bail_on_error_failure.pretty | 40 - .../standard/eqwalize_all_diagnostics.jsonl | 10 +- .../standard/eqwalize_all_diagnostics.pretty | 40 - .../eqwalize_all_diagnostics_gen.jsonl | 10 +- .../test/standard/eqwalize_app_a.jsonl | 6 +- .../test/standard/eqwalize_app_a.pretty | 26 - .../standard/eqwalize_app_a_lists_fast.pretty | 14 - .../standard/eqwalize_app_diagnostics.pretty | 40 - .../eqwalize_app_diagnostics_gen.pretty | 40 - .../eqwalize_app_diagnostics_gen_rebar.pretty | 40 - .../eqwalize_app_diagnostics_rebar.pretty | 40 - .../eqwalize_target_diagnostics.pretty | 40 - crates/elp/tests/slow-tests/main.rs | 6 +- 73 files changed, 43 insertions(+), 3532 deletions(-) diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/any_fun_type.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/any_fun_type.pretty index c2a5c42406..69251d1a75 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/any_fun_type.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/any_fun_type.pretty @@ -37,12 +37,6 @@ Because in the expression's type: Here the type is: fun((term()) -> term()) Context expects type: fun((term(), term()) -> term()) ------------------------------- Detailed message ------------------------------ - - fun((term()) -> term()) is not compatible with f2() - because - fun((term()) -> term()) is not compatible with fun((term(), term()) -> term()) - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/any_fun_type.erl:64:1 │ @@ -67,16 +61,6 @@ Because in the expression's type: Differs from the expected type: 'a' ) ------------------------------- Detailed message ------------------------------ - - f5('a' | 'b') is not compatible with f4('a') - because - fun((term()) -> 'a' | 'b') is not compatible with f4('a') - because - fun((term()) -> 'a' | 'b') is not compatible with fun((...) -> 'a') - because - 'a' | 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/any_fun_type.erl:98:20 │ @@ -103,14 +87,4 @@ Because in the expression's type: Differs from the expected type: 'a' ) ------------------------------- Detailed message ------------------------------ - - fun((term()) -> 'a' | 'b') is not compatible with f4('a') - because - fun((term()) -> 'a' | 'b') is not compatible with fun((...) -> 'a') - because - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - 7 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/approx.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/approx.pretty index 0fe7555553..15655d9cac 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/approx.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/approx.pretty @@ -60,12 +60,6 @@ Because in the expression's type: However the following candidate: string() Differs from the expected type: 'anything' ------------------------------- Detailed message ------------------------------ - - string() | dynamic() is not compatible with 'anything' - because - string() is not compatible with 'anything' - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/approx.erl:74:1 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/auto_imports.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/auto_imports.pretty index f1d2ca6927..2c9ecb3a1f 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/auto_imports.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/auto_imports.pretty @@ -2,15 +2,8 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/auto_imports.erl:22:20 │ 22 │ erlang:error(ok, ok). - │ ^^ - │ │ - │ 'ok'. + │ ^^ 'ok'. Expression has type: 'ok' Context expected type: [term()] | 'none' - │ - - 'ok' is not compatible with [term()] | 'none' - because - 'ok' is not compatible with [term()] 1 ERROR diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/booleans.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/booleans.pretty index 4407c43d42..7227163b41 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/booleans.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/booleans.pretty @@ -22,10 +22,4 @@ Because in the expression's type: However the following candidate: 'false' Differs from the expected type: 'true' ------------------------------- Detailed message ------------------------------ - - 'false' | 'true' is not compatible with 'true' - because - 'false' is not compatible with 'true' - 2 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/case_predicates.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/case_predicates.pretty index 9aff530657..a3bc7c96f9 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/case_predicates.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/case_predicates.pretty @@ -72,17 +72,6 @@ Because in the expression's type: Differs from the expected type: pid() } ------------------------------- Detailed message ------------------------------ - - {'p', pid() | reference()} is not compatible with {'a', atom()} | {'p', pid()} - because - at tuple index 2: - {'p', pid() | reference()} is not compatible with {'p', pid()} - because - pid() | reference() is not compatible with pid() - because - reference() is not compatible with pid() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/case_predicates.erl:144:10 │ @@ -99,14 +88,6 @@ Because in the expression's type: However the following candidate: 'restarting' Differs from the expected type: {'p', pid()} | 'undefined' ------------------------------- Detailed message ------------------------------ - - 'undefined' | 'restarting' is not compatible with {'p', pid()} | 'undefined' - because - 'restarting' is not compatible with {'p', pid()} | 'undefined' - because - 'restarting' is not compatible with {'p', pid()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/case_predicates.erl:174:16 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/complex_maps.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/complex_maps.pretty index 3143803509..aae5348c54 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/complex_maps.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/complex_maps.pretty @@ -14,10 +14,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: c. ------------------------------- Detailed message ------------------------------ - -key `c` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:17:21 │ @@ -35,15 +31,6 @@ Because in the expression's type: Context expects type: number() , ... } ------------------------------- Detailed message ------------------------------ - - #{a => 'b', c => 'd'} is not compatible with #{a => 'b', atom() => number()} - because - #{a => 'b', c => 'd'} is not compatible with #{a => 'b', atom() => number()} - key `c` is declared in the former but not in the latter and key `c` isn't compatible with the default association of the latter map - because - 'd' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:20:19 │ @@ -60,13 +47,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{a => 'b', atom() => atom()} is not compatible with #{a => 'b', c => 'd'} - key c is not present in the former map but is incompatible with its default association - because - atom() is not compatible with 'd' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:23:19 │ @@ -85,13 +65,6 @@ Because in the expression's type: , ... } The context introduces a new association c => 'd' which is incompatible with the expression's default association. ------------------------------- Detailed message ------------------------------ - - #{a => 'b', atom() => number()} is not compatible with #{a => 'b', c => 'd', atom() => number()} - key c is not present in the former map but is incompatible with its default association - because - number() is not compatible with 'd' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:38:21 │ @@ -108,13 +81,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{a => 'b', atom() => atom()} is not compatible with #{a => 'b'} - because - #{a => 'b', atom() => atom()} is not compatible with #{a => 'b'} - the latter map has no default association while the first map has one - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:44:26 │ @@ -131,13 +97,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{a => 'b', dynamic(atom()) => atom()} is not compatible with #{a => 'b'} - because - #{a => 'b', dynamic(atom()) => atom()} is not compatible with #{a => 'b'} - the latter map has no default association while the first map has one - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:47:26 │ @@ -154,13 +113,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{a => 'b', atom() => dynamic(atom())} is not compatible with #{a => 'b'} - because - #{a => 'b', atom() => dynamic(atom())} is not compatible with #{a => 'b'} - the latter map has no default association while the first map has one - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:56:44 │ @@ -218,13 +170,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{atom() => binary()} is not compatible with #{a => binary(), atom() => atom()} - the default associations are not compatible - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:83:28 │ @@ -242,13 +187,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{a := 'b', atom() => binary()} is not compatible with #{a => 'b', {c, d} => atom() | binary(), term() => atom()} - the default associations are not compatible - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:86:28 │ @@ -266,13 +204,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{a := 'b', atom() => binary()} is not compatible with #{a => 'b', {c, d} => atom() | binary(), atom() => atom()} - the default associations are not compatible - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/complex_maps.erl:89:29 │ @@ -290,11 +221,4 @@ Because in the expression's type: Context expects type: binary() , ... } ------------------------------- Detailed message ------------------------------ - - #{dynamic() => atom()} is not compatible with #{dynamic() => binary()} - the default associations are not compatible - because - atom() is not compatible with binary() - 16 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/comprehensions.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/comprehensions.pretty index 396ce7fc52..2b387ca9b9 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/comprehensions.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/comprehensions.pretty @@ -15,12 +15,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/comprehensions.erl:40:16 │ @@ -86,12 +80,6 @@ Because in the expression's type: Context expects type: binary() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [binary()] - because - number() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/comprehensions.erl:72:5 │ @@ -270,12 +258,6 @@ Because in the expression's type: Context expects type: binary() ] ------------------------------- Detailed message ------------------------------ - - [atom()] is not compatible with [binary()] - because - atom() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/comprehensions.erl:226:5 │ @@ -293,12 +275,6 @@ Because in the expression's type: Context expects type: 'false' ] ------------------------------- Detailed message ------------------------------ - - ['true'] is not compatible with ['false'] - because - 'true' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/comprehensions.erl:231:5 │ @@ -316,12 +292,6 @@ Because in the expression's type: Context expects type: 'false' ] ------------------------------- Detailed message ------------------------------ - - ['true'] is not compatible with ['false'] - because - 'true' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/comprehensions.erl:239:5 │ @@ -339,12 +309,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/comprehensions.erl:267:5 │ @@ -363,14 +327,6 @@ Because in the expression's type: Differs from the expected type: binary() ] ------------------------------- Detailed message ------------------------------ - - [binary() | 'undefined'] is not compatible with [binary()] - because - binary() | 'undefined' is not compatible with binary() - because - 'undefined' is not compatible with binary() - error: expected_fun_type (See https://fb.me/eqwalizer_errors#expected_fun_type) ┌─ check/src/comprehensions.erl:386:9 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/contravariant.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/contravariant.pretty index 69c58c0e77..f228f5cd50 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/contravariant.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/contravariant.pretty @@ -16,14 +16,4 @@ Because in the expression's type: Differs from the expected type: 'a' ) -> 'ok') ------------------------------- Detailed message ------------------------------ - - ref_contravariant('a') is not compatible with ref_contravariant_ab() - because - contravariant('a') is not compatible with ref_contravariant_ab() - because - fun(('a') -> 'ok') is not compatible with ref_contravariant_ab() - because - fun(('a') -> 'ok') is not compatible with ref_contravariant('a' | 'b') - 1 ERROR diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/custom-OTP-27.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/custom-OTP-27.pretty index 370f7689e9..efc8c47aa0 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/custom-OTP-27.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/custom-OTP-27.pretty @@ -37,12 +37,6 @@ Because in the expression's type: However the following candidate: [dynamic()] Differs from the expected type: tuple() ------------------------------- Detailed message ------------------------------ - - {atom(), string()} | [dynamic()] is not compatible with tuple() - because - [dynamic()] is not compatible with tuple() - error: index_out_of_bounds (See https://fb.me/eqwalizer_errors#index_out_of_bounds) ┌─ check/src/custom.erl:48:5 │ @@ -74,12 +68,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - atom() | number() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:68:5 │ @@ -96,12 +84,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - dynamic() | number() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:86:5 │ @@ -118,12 +100,6 @@ Because in the expression's type: However the following candidate: string() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - 'foo' | 'ok' | 'error' | number() | string() is not compatible with atom() - because - string() is not compatible with atom() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/custom.erl:91:1 │ @@ -202,12 +178,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - number() | atom() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:200:5 │ @@ -224,12 +194,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - number() | atom() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:206:5 │ @@ -249,15 +213,6 @@ Because in the expression's type: Differs from the expected type: number() } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {atom(), 'undefined' | number()} is not compatible with {atom(), number()} - because - 'undefined' | number() is not compatible with number() - because - 'undefined' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:221:27 │ @@ -274,14 +229,6 @@ Because in the expression's type: However the following candidate: 'c_v' Differs from the expected type: 'a_v' | 'b_v' ------------------------------- Detailed message ------------------------------ - - 'a_v' | 'c_v' is not compatible with 'a_v' | 'b_v' - because - 'c_v' is not compatible with 'a_v' | 'b_v' - because - 'c_v' is not compatible with 'a_v' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:233:27 │ @@ -298,14 +245,6 @@ Because in the expression's type: However the following candidate: 'c_v' Differs from the expected type: 'a_v' | 'b_v' | 'undefined' ------------------------------- Detailed message ------------------------------ - - 'undefined' | 'a_v' | 'c_v' is not compatible with 'a_v' | 'b_v' | 'undefined' - because - 'c_v' is not compatible with 'a_v' | 'b_v' | 'undefined' - because - 'c_v' is not compatible with 'a_v' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:309:5 │ @@ -362,28 +301,13 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: #{term() => term()} | maps:iterator() ------------------------------- Detailed message ------------------------------ - - #{K => V} | 'a' is not compatible with #{term() => term()} | maps:iterator() - because - 'a' is not compatible with #{term() => term()} | maps:iterator() - because - 'a' is not compatible with #{term() => term()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:425:20 │ 425 │ maps:filter(F, non_kv), - │ ^^^^^^ - │ │ - │ 'non_kv'. + │ ^^^^^^ 'non_kv'. Expression has type: 'non_kv' Context expected type: #{term() => term()} | maps:iterator() - │ - - 'non_kv' is not compatible with #{term() => term()} | maps:iterator() - because - 'non_kv' is not compatible with #{term() => term()} error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:454:5 @@ -403,13 +327,6 @@ Because in the expression's type: Context expects type: boolean() , ... } ------------------------------- Detailed message ------------------------------ - - #{number() => pid()} is not compatible with #{number() => boolean()} - the default associations are not compatible - because - pid() is not compatible with boolean() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:474:14 │ @@ -451,29 +368,13 @@ Because in the expression's type: Context expects type: 'a' , ... } ------------------------------- Detailed message ------------------------------ - - #{a := boolean(), b := boolean()} is not compatible with #{a => 'a', b => 'b'} - because - at key `a`: - #{a := boolean(), b := boolean()} is not compatible with #{a => 'a', b => 'b'} - because - boolean() is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:503:17 │ 503 │ maps:map(F, non_kv), - │ ^^^^^^ - │ │ - │ 'non_kv'. + │ ^^^^^^ 'non_kv'. Expression has type: 'non_kv' Context expected type: #{term() => term()} | maps:iterator() - │ - - 'non_kv' is not compatible with #{term() => term()} | maps:iterator() - because - 'non_kv' is not compatible with #{term() => term()} error: fun_arity_mismatch (See https://fb.me/eqwalizer_errors#fun_arity_mismatch) ┌─ check/src/custom.erl:538:9 @@ -502,14 +403,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [[[]]] is not compatible with [number() | 'a' | 'b'] - because - [[]] is not compatible with number() | 'a' | 'b' - because - [[]] is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:545:28 │ @@ -531,14 +424,6 @@ Because in the expression's type: ] ] ------------------------------- Detailed message ------------------------------ - - [[[[]]]] is not compatible with [[[]]] - because - [[[]]] is not compatible with [[]] - because - [[]] is not compatible with [] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:552:5 │ @@ -555,16 +440,9 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/custom.erl:555:9 │ 555 │ non_kv - │ ^^^^^^ - │ │ - │ 'non_kv'. + │ ^^^^^^ 'non_kv'. Expression has type: 'non_kv' Context expected type: #{term() => term()} | maps:iterator() - │ - - 'non_kv' is not compatible with #{term() => term()} | maps:iterator() - because - 'non_kv' is not compatible with #{term() => term()} error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/custom.erl:560:1 @@ -606,12 +484,6 @@ Because in the expression's type: However the following candidate: [] Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - [] | atom() is not compatible with atom() - because - [] is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:601:9 │ @@ -682,30 +554,13 @@ Because in the expression's type: Differs from the expected type: binary() ] ------------------------------- Detailed message ------------------------------ - - [number() | binary() | atom()] is not compatible with [binary()] | [number()] | [atom()] - because - [number() | binary() | atom()] is not compatible with [binary()] - because - number() | binary() | atom() is not compatible with binary() - because - number() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:671:41 │ 671 │ maps_to_list_7_neg(Num) -> maps:to_list(Num). - │ ^^^ - │ │ - │ Num. + │ ^^^ Num. Expression has type: number() Context expected type: #{term() => term()} | maps:iterator() - │ - - number() is not compatible with #{term() => term()} | maps:iterator() - because - number() is not compatible with #{term() => term()} error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:675:25 @@ -723,13 +578,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{'b' | 'a' | 'c' => number() | string() | atom()} is not compatible with #{a => string(), b => number(), c => atom()} - key a is not present in the former map but is incompatible with its default association - because - number() | string() | atom() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:679:25 │ @@ -746,13 +594,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{'b' | 'a' | 'c' => number() | string() | atom()} is not compatible with #{a => string(), b => number() | boolean(), c => atom()} - key a is not present in the former map but is incompatible with its default association - because - number() | string() | atom() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:683:25 │ @@ -769,10 +610,6 @@ Because in the expression's type: Context expects type: #{a := ..., b := ..., ...} The type of the expression is missing the following required keys: a, b. ------------------------------- Detailed message ------------------------------ - -keys `a`, `b` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:697:44 │ @@ -797,13 +634,6 @@ Because in the expression's type: Context expects type: #{a := ..., b := ..., ...} The type of the expression is missing the following required keys: a, b. ------------------------------- Detailed message ------------------------------ - - #{'a' | 'b' => atom() | number()} is not compatible with #{a := atom(), b := number()} | #{a := atom()} - because - #{'a' | 'b' => atom() | number()} is not compatible with #{a := atom(), b := number()} - keys `a`, `b` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:721:9 │ @@ -822,14 +652,6 @@ Because in the expression's type: No candidate matches in the expected union. ) ------------------------------- Detailed message ------------------------------ - - fun((binary()) -> [number()]) is not compatible with fun((number()) -> boolean() | {'true', term()}) - because - [number()] is not compatible with boolean() | {'true', term()} - because - [number()] is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:739:20 │ @@ -846,12 +668,6 @@ Because in the expression's type: Context expects type: 'false' | 'true' | {'true', term()} No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - 'wrong_ret' is not compatible with boolean() | {'true', term()} - because - 'wrong_ret' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:749:9 │ @@ -876,14 +692,6 @@ Because in the expression's type: However the following candidate: 'wrong_ret' Differs from the expected type: 'false' | 'true' | {'true', term()} ------------------------------- Detailed message ------------------------------ - - {'true', 'a'} | 'wrong_ret' is not compatible with boolean() | {'true', term()} - because - 'wrong_ret' is not compatible with boolean() | {'true', term()} - because - 'wrong_ret' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:827:9 │ @@ -902,16 +710,6 @@ Because in the expression's type: Differs from the expected type: 'false' | 'true' | ['a' | 'b'] ) ------------------------------- Detailed message ------------------------------ - - fun(('a' | 'b') -> ['a'] | 'true' | 'wrong_ret') is not compatible with fun(('a' | 'b') -> boolean() | ['a' | 'b']) - because - ['a'] | 'true' | 'wrong_ret' is not compatible with boolean() | ['a' | 'b'] - because - 'wrong_ret' is not compatible with boolean() | ['a' | 'b'] - because - 'wrong_ret' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:829:20 │ @@ -928,12 +726,6 @@ Because in the expression's type: Context expects type: 'false' | 'true' | ['a' | 'b'] No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - 'wrong_ret' is not compatible with boolean() | ['a' | 'b'] - because - 'wrong_ret' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:837:9 │ @@ -951,15 +743,6 @@ Because in the expression's type: Differs from the expected type: 'false' | 'true' | [Item] ) ------------------------------- Detailed message ------------------------------ - - fun((dynamic()) -> {'true', 'a'} | 'true') is not compatible with fun((Item) -> boolean() | [Item]) - because - {'true', 'a'} | 'true' is not compatible with boolean() | [Item] - because - {'true', 'a'} is not compatible with boolean() | [Item] - expected union does not contain any tuple type of size 2 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:837:20 │ @@ -976,10 +759,6 @@ Because in the expression's type: Context expects type: 'false' | 'true' | [dynamic()] No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - -expected union does not contain any tuple type of size 2 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:839:9 │ @@ -995,12 +774,6 @@ Because in the expression's type: Here the type is: 'not_a_queue' Context expects type: {[Item], [Item]} ------------------------------- Detailed message ------------------------------ - - 'not_a_queue' is not compatible with queue:queue(Item) - because - 'not_a_queue' is not compatible with {[Item], [Item]} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:839:9 │ @@ -1016,12 +789,6 @@ Because in the expression's type: Here the type is: 'not_a_queue' Context expects type: {[dynamic()], [dynamic()]} ------------------------------- Detailed message ------------------------------ - - 'not_a_queue' is not compatible with queue:queue(dynamic()) - because - 'not_a_queue' is not compatible with {[dynamic()], [dynamic()]} - error: fun_arity_mismatch (See https://fb.me/eqwalizer_errors#fun_arity_mismatch) ┌─ check/src/custom.erl:846:9 │ @@ -1053,15 +820,6 @@ Because in the expression's type: Differs from the expected type: 'false' | 'true' | ['a' | 'b'] ) ------------------------------- Detailed message ------------------------------ - - fun(('a' | 'b') -> ['a'] | 'false' | {'true', 'a'}) is not compatible with fun(('a' | 'b') -> boolean() | ['a' | 'b']) - because - ['a'] | 'false' | {'true', 'a'} is not compatible with boolean() | ['a' | 'b'] - because - {'true', 'a'} is not compatible with boolean() | ['a' | 'b'] - expected union does not contain any tuple type of size 2 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:857:20 │ @@ -1078,10 +836,6 @@ Because in the expression's type: Context expects type: 'false' | 'true' | ['a' | 'b'] No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - -expected union does not contain any tuple type of size 2 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:873:9 │ @@ -1104,16 +858,6 @@ Because in the expression's type: Differs from the expected type: 'false' | 'true' | ['a' | 'b'] ) ------------------------------- Detailed message ------------------------------ - - fun(('a' | 'b') -> ['a'] | 'wrong_ret') is not compatible with fun(('a' | 'b') -> boolean() | ['a' | 'b']) - because - ['a'] | 'wrong_ret' is not compatible with boolean() | ['a' | 'b'] - because - 'wrong_ret' is not compatible with boolean() | ['a' | 'b'] - because - 'wrong_ret' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:881:17 │ @@ -1130,14 +874,6 @@ Because in the expression's type: However the following candidate: 'wrong_ret' Differs from the expected type: 'false' | 'true' | ['a' | 'b'] ------------------------------- Detailed message ------------------------------ - - ['a'] | 'wrong_ret' is not compatible with boolean() | ['a' | 'b'] - because - 'wrong_ret' is not compatible with boolean() | ['a' | 'b'] - because - 'wrong_ret' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:891:9 │ @@ -1156,14 +892,6 @@ Because in the expression's type: No candidate matches in the expected union. ) ------------------------------- Detailed message ------------------------------ - - fun((string()) -> atom()) is not compatible with fun((dynamic()) -> boolean() | [dynamic()]) - because - atom() is not compatible with boolean() | [dynamic()] - because - atom() is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:891:9 │ @@ -1182,14 +910,6 @@ Because in the expression's type: No candidate matches in the expected union. ) ------------------------------- Detailed message ------------------------------ - - fun((string()) -> atom()) is not compatible with fun(('a' | 'b') -> boolean() | ['a' | 'b']) - because - atom() is not compatible with boolean() | ['a' | 'b'] - because - atom() is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:900:9 │ @@ -1207,12 +927,6 @@ Because in the expression's type: Context expects type: boolean() | [atom()] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((atom()) -> boolean() | [atom()]) - because - string() is not compatible with boolean() | [atom()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:900:9 │ @@ -1230,12 +944,6 @@ Because in the expression's type: Context expects type: boolean() | [dynamic(atom())] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((dynamic(atom())) -> boolean() | [dynamic(atom())]) - because - string() is not compatible with boolean() | [dynamic(atom())] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:909:9 │ @@ -1253,12 +961,6 @@ Because in the expression's type: Context expects type: boolean() | [atom()] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((atom()) -> boolean() | [atom()]) - because - string() is not compatible with boolean() | [atom()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:909:9 │ @@ -1276,12 +978,6 @@ Because in the expression's type: Context expects type: boolean() | [dynamic(atom())] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((dynamic(atom())) -> boolean() | [dynamic(atom())]) - because - string() is not compatible with boolean() | [dynamic(atom())] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:919:9 │ @@ -1299,12 +995,6 @@ Because in the expression's type: Context expects type: boolean() | [atom()] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((atom()) -> boolean() | [atom()]) - because - string() is not compatible with boolean() | [atom()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:919:9 │ @@ -1322,12 +1012,6 @@ Because in the expression's type: Context expects type: boolean() | [dynamic(atom())] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((dynamic(atom())) -> boolean() | [dynamic(atom())]) - because - string() is not compatible with boolean() | [dynamic(atom())] - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/custom.erl:925:1 │ @@ -1356,12 +1040,6 @@ Because in the expression's type: Context expects type: boolean() | [atom()] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((atom()) -> boolean() | [atom()]) - because - string() is not compatible with boolean() | [atom()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:927:9 │ @@ -1379,12 +1057,6 @@ Because in the expression's type: Context expects type: boolean() | [dynamic(atom())] ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((dynamic(atom())) -> boolean() | [dynamic(atom())]) - because - string() is not compatible with boolean() | [dynamic(atom())] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:955:5 │ @@ -1434,12 +1106,6 @@ Because in the expression's type: Context expects type: tuple() ] ------------------------------- Detailed message ------------------------------ - - ['non_tuple'] is not compatible with [tuple()] - because - 'non_tuple' is not compatible with tuple() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:975:5 │ @@ -1540,14 +1206,6 @@ Because in the expression's type: Differs from the expected type: number() ] ------------------------------- Detailed message ------------------------------ - - ['a' | number()] is not compatible with [number()] - because - 'a' | number() is not compatible with number() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1042:15 │ @@ -1592,31 +1250,17 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/custom.erl:1100:5 │ 1100 │ proplists:get_value(k, L). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('k', L). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('k', L). Expression has type: term() Context expected type: pid() | 'undefined' - │ - - term() is not compatible with pid() | 'undefined' - because - term() is not compatible with pid() error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1106:5 │ 1106 │ proplists:get_value(k, L). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('k', L). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('k', L). Expression has type: term() Context expected type: pid() | 'undefined' | 'v' - │ - - term() is not compatible with pid() | 'undefined' | 'v' - because - term() is not compatible with pid() error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1111:5 @@ -1630,31 +1274,17 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/custom.erl:1117:5 │ 1117 │ proplists:get_value(k, L, 3). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('k', L, 3). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('k', L, 3). Expression has type: term() Context expected type: pid() | number() - │ - - term() is not compatible with pid() | number() - because - term() is not compatible with pid() error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1123:5 │ 1123 │ proplists:get_value(k, L, my_default). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('k', L, 'my_default'). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('k', L, 'my_default'). Expression has type: term() Context expected type: 'v1' | 'v2' | 'my_default' - │ - - term() is not compatible with 'v1' | 'v2' | 'my_default' - because - term() is not compatible with 'v1' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1129:5 @@ -1722,14 +1352,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [pid() | 'default'] - because - term() is not compatible with pid() | 'default' - because - term() is not compatible with pid() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1166:5 │ @@ -1748,14 +1370,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [pid() | 'default' | 'v'] - because - term() is not compatible with pid() | 'default' | 'v' - because - term() is not compatible with pid() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1171:5 │ @@ -1773,12 +1387,6 @@ Because in the expression's type: Context expects type: pid() ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [pid()] - because - term() is not compatible with pid() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1176:5 │ @@ -1846,12 +1454,6 @@ Because in the expression's type: Context expects type: 'c' ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with ['c'] - because - term() is not compatible with 'c' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1197:5 │ @@ -1870,14 +1472,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with ['a' | 'b' | 'c'] - because - term() is not compatible with 'a' | 'b' | 'c' - because - term() is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1202:24 │ @@ -1903,41 +1497,21 @@ Because in the expression's type: Context expects type: 'a' ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with ['a'] - because - term() is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1215:5 │ 1215 │ proplists:get_value(k, L). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('k', L). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('k', L). Expression has type: term() Context expected type: 'a' | pid() - │ - - term() is not compatible with 'a' | pid() - because - term() is not compatible with 'a' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1220:5 │ 1220 │ proplists:get_value(k, b). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('k', 'b'). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('k', 'b'). Expression has type: term() Context expected type: 'a' | pid() - │ - - term() is not compatible with 'a' | pid() - because - term() is not compatible with 'a' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1220:28 @@ -1987,12 +1561,6 @@ Because in the expression's type: However the following candidate: tuple() Differs from the expected type: 'none' ------------------------------- Detailed message ------------------------------ - - 'none' | tuple() is not compatible with 'none' - because - tuple() is not compatible with 'none' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1252:29 │ @@ -2065,17 +1633,6 @@ Because in the expression's type: ] , [term()]} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {[[term()]], [term()]} is not compatible with {[plist('a', 'b')], plist('a', 'b')} - because - [[term()]] is not compatible with [plist('a', 'b')] - because - [term()] is not compatible with plist('a', 'b') - because - [term()] is not compatible with ['a' | {'a', 'b'}] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1315:21 │ @@ -2120,46 +1677,25 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/custom.erl:1363:5 │ 1363 │ proplists:get_value(a, [a]). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('a', ['a']). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('a', ['a']). Expression has type: term() Context expected type: 'true' | 'undefined' - │ - - term() is not compatible with 'true' | 'undefined' - because - term() is not compatible with 'true' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1368:5 │ 1368 │ proplists:get_value(X, [a]). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value(X, ['a']). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value(X, ['a']). Expression has type: term() Context expected type: 'true' | 'undefined' - │ - - term() is not compatible with 'true' | 'undefined' - because - term() is not compatible with 'true' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1373:5 │ 1373 │ proplists:get_value(a, [a], b). - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - │ │ - │ proplists:get_value('a', ['a'], 'b'). + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ proplists:get_value('a', ['a'], 'b'). Expression has type: term() Context expected type: 'true' | 'b' - │ - - term() is not compatible with 'true' | 'b' - because - term() is not compatible with 'true' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1416:5 @@ -2194,12 +1730,6 @@ Because in the expression's type: Context expects type: tuple() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [tuple()] - because - number() is not compatible with tuple() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1448:5 │ @@ -2222,14 +1752,6 @@ Because in the expression's type: Differs from the expected type: number() ] ------------------------------- Detailed message ------------------------------ - - [string() | number()] is not compatible with [number()] - because - string() | number() is not compatible with number() - because - string() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1482:5 │ @@ -2373,17 +1895,6 @@ Because in the expression's type: , A} ] ------------------------------- Detailed message ------------------------------ - - [{A, B} | {B, A}] is not compatible with [{A, B}] - because - {A, B} | {B, A} is not compatible with {A, B} - because - at tuple index 1: - {B, A} is not compatible with {A, B} - because - B is not compatible with A - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1757:5 │ @@ -2404,10 +1915,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1769:18 │ @@ -2451,10 +1958,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1826:5 │ @@ -2472,10 +1975,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1827:12 │ @@ -2501,10 +2000,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1854:5 │ @@ -2525,16 +2020,9 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/custom.erl:1916:23 │ 1916 │ custom_overloaded(X). - │ ^ - │ │ - │ X. + │ ^ X. Expression has type: term() Context expected type: atom() | binary() - │ - - term() is not compatible with atom() | binary() - because - term() is not compatible with atom() error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:1939:5 @@ -2554,15 +2042,6 @@ Because in the expression's type: Differs from the expected type: number() } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {atom(), number() | pid()} is not compatible with {atom(), number()} - because - number() | pid() is not compatible with number() - because - pid() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2041:5 │ @@ -2578,14 +2057,6 @@ Because in the expression's type: Here the type is: string() | binary() Context expects type: string() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with file:filename() - because - string() | binary() is not compatible with file:filename() - because - string() | binary() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2046:5 │ @@ -2601,14 +2072,6 @@ Because in the expression's type: Here the type is: string() | binary() Context expects type: string() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with file:filename() - because - string() | binary() is not compatible with file:filename() - because - string() | binary() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2051:5 │ @@ -2624,14 +2087,6 @@ Because in the expression's type: Here the type is: string() | binary() Context expects type: string() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with file:filename() - because - string() | binary() is not compatible with file:filename() - because - string() | binary() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2066:5 │ @@ -2648,14 +2103,6 @@ Because in the expression's type: However the following candidate: string() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with binary() - because - string() | binary() is not compatible with binary() - because - string() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2081:19 │ @@ -2674,16 +2121,6 @@ Because in the expression's type: Differs from the expected type: string() | atom() | file:deep_list() | binary() ] ------------------------------- Detailed message ------------------------------ - - [binary() | pid()] is not compatible with [file:name_all()] - because - binary() | pid() is not compatible with file:name_all() - because - binary() | pid() is not compatible with string() | atom() | file:deep_list() | binary() - because - pid() is not compatible with string() | atom() | file:deep_list() | binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2086:5 │ @@ -2699,14 +2136,6 @@ Because in the expression's type: Here the type is: string() | binary() Context expects type: string() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with file:filename() - because - string() | binary() is not compatible with file:filename() - because - string() | binary() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2091:5 │ @@ -2722,14 +2151,6 @@ Because in the expression's type: Here the type is: string() | binary() Context expects type: string() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with file:filename() - because - string() | binary() is not compatible with file:filename() - because - string() | binary() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2096:5 │ @@ -2745,14 +2166,6 @@ Because in the expression's type: Here the type is: string() | binary() Context expects type: string() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with file:filename() - because - string() | binary() is not compatible with file:filename() - because - string() | binary() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2111:5 │ @@ -2769,14 +2182,6 @@ Because in the expression's type: However the following candidate: string() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with binary() - because - string() | binary() is not compatible with binary() - because - string() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2121:25 │ @@ -2793,14 +2198,6 @@ Because in the expression's type: Context expects type: string() | atom() | file:deep_list() | binary() No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - pid() is not compatible with file:name_all() - because - pid() is not compatible with string() | atom() | file:deep_list() | binary() - because - pid() is not compatible with string() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2150:5 │ @@ -2822,17 +2219,6 @@ Because in the expression's type: ] , [atom() | number()]} ------------------------------- Detailed message ------------------------------ - - queue:queue(atom() | number()) is not compatible with queue:queue(number()) - because - {[atom() | number()], [atom() | number()]} is not compatible with queue:queue(number()) - because - at tuple index 1: - {[atom() | number()], [atom() | number()]} is not compatible with {[number()], [number()]} - because - [atom() | number()] is not compatible with [number()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2191:5 │ @@ -2851,15 +2237,6 @@ Because in the expression's type: Context expects type: #{count := ..., ...} The type of the expression is missing the following required keys: count. ------------------------------- Detailed message ------------------------------ - - #{count := number(), module := 'foo'} | #{module := 'foo'} is not compatible with state1() - because - #{count := number(), module := 'foo'} | #{module := 'foo'} is not compatible with #{count := number(), module := atom()} - because - #{module := 'foo'} is not compatible with #{count := number(), module := atom()} - key `count` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2223:13 │ @@ -2884,10 +2261,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2320:5 │ @@ -2908,10 +2281,6 @@ Because in the expression's type: Context expects type: #{a := ..., b := ..., ...} The type of the expression is missing the following required keys: a, b. ------------------------------- Detailed message ------------------------------ - -keys `a`, `b` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2342:5 │ @@ -2932,13 +2301,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{atom() => binary()} is not compatible with #{atom() => atom()} - the default associations are not compatible - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2354:23 │ @@ -2955,12 +2317,6 @@ Because in the expression's type: Context expects type: 'false' | 'true' | {'true', term()} No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - 'err' is not compatible with boolean() | {'true', term()} - because - 'err' is not compatible with 'false' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2362:5 │ @@ -2979,13 +2335,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{atom() => binary()} is not compatible with #{atom() => atom()} - the default associations are not compatible - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2363:45 │ @@ -3026,12 +2375,6 @@ Because in the expression's type: Context expects type: iolist() | binary() No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - atom() is not compatible with iodata() | unicode:charlist() - because - atom() is not compatible with iolist() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2386:5 │ @@ -3060,17 +2403,6 @@ Because in the expression's type: } ] ------------------------------- Detailed message ------------------------------ - - [{'return', 'something'}] is not compatible with [{'newline', 'cr' | 'lf' | 'any' | 'crlf' | 'anycrlf'} | 'notempty_atstart' | 'noteol' | 'bsr_unicode' | 'notbol' | 'global' | {'match_limit_recursion', number()} | 'bsr_anycrlf' | re:compile_option() | {'match_limit', number()} | {'offset', number()} | 'notempty' | {'return', 'iodata' | 'list' | 'binary'} | 'anchored'] - because - {'return', 'something'} is not compatible with {'newline', 'cr' | 'lf' | 'any' | 'crlf' | 'anycrlf'} | 'notempty_atstart' | 'noteol' | 'bsr_unicode' | 'notbol' | 'global' | {'match_limit_recursion', number()} | 'bsr_anycrlf' | re:compile_option() | {'match_limit', number()} | {'offset', number()} | 'notempty' | {'return', 'iodata' | 'list' | 'binary'} | 'anchored' - because - at tuple index 2: - {'return', 'something'} is not compatible with {'return', 'iodata' | 'list' | 'binary'} - because - 'something' is not compatible with 'iodata' | 'list' | 'binary' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2506:5 │ @@ -3090,15 +2422,6 @@ Because in the expression's type: ] , [atom()]} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {[number()], [atom()]} is not compatible with {[atom()], [number()]} - because - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2518:5 │ @@ -3120,18 +2443,6 @@ Because in the expression's type: ] , [{term(), atom()}]} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {[{term(), number()}], [{term(), atom()}]} is not compatible with {[{term(), atom()}], [{term(), number()}]} - because - [{term(), number()}] is not compatible with [{term(), atom()}] - because - at tuple index 2: - {term(), number()} is not compatible with {term(), atom()} - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2536:5 │ @@ -3153,18 +2464,6 @@ Because in the expression's type: ] } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {[{'ok', atom()}], [{'ok', atom()} | {'error', term()}]} is not compatible with {[{'ok', atom()}], [{'error', term()}]} - because - [{'ok', atom()} | {'error', term()}] is not compatible with [{'error', term()}] - because - {'ok', atom()} | {'error', term()} is not compatible with {'error', term()} - because - at tuple index 1: - {'ok', atom()} is not compatible with {'error', term()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2576:33 │ @@ -3181,10 +2480,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2586:33 │ @@ -3202,15 +2497,6 @@ Because in the expression's type: Context expects type: 'true' , ... } ------------------------------- Detailed message ------------------------------ - - #{a => number()} is not compatible with #{a => 'true'} - because - at key `a`: - #{a => number()} is not compatible with #{a => 'true'} - because - number() is not compatible with 'true' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2596:33 │ @@ -3227,10 +2513,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/custom.erl:2709:40 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_calls.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_calls.pretty index a8dc692a9b..bc6265b8c1 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_calls.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_calls.pretty @@ -66,61 +66,33 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/dynamic_calls.erl:78:14 │ 78 │ (FUnion)(false). - │ ^^^^^ - │ │ - │ 'false'. + │ ^^^^^ 'false'. Expression has type: 'false' Context expected type: 'a1' | 'a2' - │ - - 'false' is not compatible with 'a1' | 'a2' - because - 'false' is not compatible with 'a1' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_calls.erl:78:14 │ 78 │ (FUnion)(false). - │ ^^^^^ - │ │ - │ 'false'. + │ ^^^^^ 'false'. Expression has type: 'false' Context expected type: 'a2' | 'a3' - │ - - 'false' is not compatible with 'a2' | 'a3' - because - 'false' is not compatible with 'a2' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_calls.erl:86:20 │ 86 │ Res = (FUnion)(false), - │ ^^^^^ - │ │ - │ 'false'. + │ ^^^^^ 'false'. Expression has type: 'false' Context expected type: 'a1' | 'a2' - │ - - 'false' is not compatible with 'a1' | 'a2' - because - 'false' is not compatible with 'a1' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_calls.erl:86:20 │ 86 │ Res = (FUnion)(false), - │ ^^^^^ - │ │ - │ 'false'. + │ ^^^^^ 'false'. Expression has type: 'false' Context expected type: 'a2' | 'a3' - │ - - 'false' is not compatible with 'a2' | 'a3' - because - 'false' is not compatible with 'a2' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_calls.erl:87:5 @@ -146,12 +118,6 @@ Because in the expression's type: However the following candidate: 'r2' Differs from the expected type: 'r1' ------------------------------- Detailed message ------------------------------ - - 'r1' | 'r2' is not compatible with 'r1' - because - 'r2' is not compatible with 'r1' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_calls.erl:94:5 │ @@ -176,12 +142,6 @@ Because in the expression's type: However the following candidate: 'r2' Differs from the expected type: 'r1' ------------------------------- Detailed message ------------------------------ - - 'r1' | 'r2' | 'r3' is not compatible with 'r1' - because - 'r2' is not compatible with 'r1' - error: expected_fun_type (See https://fb.me/eqwalizer_errors#expected_fun_type) ┌─ check/src/dynamic_calls.erl:108:5 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_catch.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_catch.pretty index a8135429d1..78fd9f16f2 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_catch.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_catch.pretty @@ -14,10 +14,4 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - atom() | dynamic() is not compatible with binary() - because - atom() is not compatible with binary() - 1 ERROR diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_fun.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_fun.pretty index 1f55b0f88a..7f7add29a8 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_fun.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_fun.pretty @@ -72,16 +72,6 @@ Because in the expression's type: Differs from the expected type: 'a' ) ------------------------------- Detailed message ------------------------------ - - f5('a' | 'b') is not compatible with f4('a') - because - fun((term()) -> 'a' | 'b') is not compatible with f4('a') - because - fun((term()) -> 'a' | 'b') is not compatible with fun((...) -> 'a') - because - 'a' | 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_fun.erl:155:20 │ @@ -108,16 +98,6 @@ Because in the expression's type: Differs from the expected type: 'a' ) ------------------------------- Detailed message ------------------------------ - - fun((term()) -> 'a' | 'b') is not compatible with f4('a') - because - fun((term()) -> 'a' | 'b') is not compatible with fun((...) -> 'a') - because - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_fun.erl:176:21 │ @@ -136,16 +116,6 @@ Because in the expression's type: Differs from the expected type: 'a' ) ------------------------------- Detailed message ------------------------------ - - f4('a' | 'b') is not compatible with fun((term()) -> 'a') - because - fun((...) -> 'a' | 'b') is not compatible with fun((term()) -> 'a') - because - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_fun.erl:208:34 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_generics.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_generics.pretty index cd54f2d176..78c9a41f3f 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_generics.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_generics.pretty @@ -38,12 +38,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: none() ------------------------------- Detailed message ------------------------------ - - number() | dynamic() is not compatible with none() - because - number() is not compatible with none() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_generics.erl:72:3 │ @@ -68,12 +62,6 @@ Because in the expression's type: However the following candidate: string() Differs from the expected type: 'ok' ------------------------------- Detailed message ------------------------------ - - dynamic() | string() is not compatible with 'ok' - because - string() is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_generics.erl:87:3 │ @@ -112,14 +100,6 @@ Because in the expression's type: Differs from the expected type: number() ] ------------------------------- Detailed message ------------------------------ - - [number() | 'three'] is not compatible with [number()] - because - number() | 'three' is not compatible with number() - because - 'three' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_generics.erl:115:9 │ @@ -136,12 +116,6 @@ Because in the expression's type: However the following candidate: 'three' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | 'three' is not compatible with number() - because - 'three' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_generics.erl:115:22 │ @@ -158,12 +132,6 @@ Because in the expression's type: However the following candidate: 'three' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | 'three' is not compatible with number() - because - 'three' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_generics.erl:127:13 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_local_funs.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_local_funs.pretty index 3ca5a136e6..6e82aa3702 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_local_funs.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_local_funs.pretty @@ -14,12 +14,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - dynamic() | number() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_local_funs.erl:36:15 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_refine.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_refine.pretty index 9d7187f610..ce03971816 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_refine.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/dynamic_refine.pretty @@ -100,12 +100,6 @@ Because in the expression's type: However the following candidate: 'error' Differs from the expected type: 'ok' ------------------------------- Detailed message ------------------------------ - - dynamic() | 'error' is not compatible with 'ok' - because - 'error' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_refine.erl:236:3 │ @@ -138,12 +132,6 @@ Because in the expression's type: However the following candidate: 'err' Differs from the expected type: 'ok' ------------------------------- Detailed message ------------------------------ - - dyn_alias() | 'err' is not compatible with 'ok' - because - 'err' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/dynamic_refine.erl:260:27 │ @@ -162,15 +150,4 @@ Because in the expression's type: Differs from the expected type: 'ok' } ------------------------------- Detailed message ------------------------------ - - union() is not compatible with {'ok'} - because - at tuple index 1: - {dyn_alias() | 'err'} is not compatible with {'ok'} - because - dyn_alias() | 'err' is not compatible with 'ok' - because - 'err' is not compatible with 'ok' - 16 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/elab_clause.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/elab_clause.pretty index b9fdc2fbce..e02928cc14 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/elab_clause.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/elab_clause.pretty @@ -38,12 +38,6 @@ Because in the expression's type: However the following candidate: 'error' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - 'error' | 'exit' | 'throw' | number() is not compatible with number() - because - 'error' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/elab_clause.erl:86:5 │ @@ -60,12 +54,6 @@ Because in the expression's type: However the following candidate: [dynamic()] Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | [dynamic()] is not compatible with number() - because - [dynamic()] is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/elab_clause.erl:93:17 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/error_messages.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/error_messages.pretty index ab48c38337..fab550d5e6 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/error_messages.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/error_messages.pretty @@ -15,17 +15,6 @@ Because in the expression's type: Context expects type: number() , ... } ------------------------------- Detailed message ------------------------------ - - #{bar := atom(), baz := atom()} is not compatible with foo_map() | #{foo => atom()} - because - #{bar := atom(), baz := atom()} is not compatible with foo_map() - because - #{bar := atom(), baz := atom()} is not compatible with #{bar => atom(), baz => number(), other => atom(), other2 => atom(), other3 => atom(), other4 => atom(), other5 => atom()} - because - at key `baz`: - #{bar := atom(), baz := atom()} is not compatible with #{bar => atom(), baz => number(), other => atom(), other2 => atom(), other3 => atom(), other4 => atom(), other5 => atom()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/error_messages.erl:19:24 │ @@ -44,12 +33,6 @@ Because in the expression's type: The expected map has no corresponding key for: baz. ] ------------------------------- Detailed message ------------------------------ - - [#{bar => 'a' | 'b'} | #{baz => 'a' | 'b'}] is not compatible with [#{bar => 'a'}] - because - #{bar => 'a' | 'b'} | #{baz => 'a' | 'b'} is not compatible with #{bar => 'a'} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/error_messages.erl:22:22 │ @@ -68,15 +51,6 @@ Because in the expression's type: Differs from the expected type: binary() , ... } ------------------------------- Detailed message ------------------------------ - - #{'undefined' | binary() => atom()} is not compatible with #{binary() => atom()} - the default associations are not compatible - because - 'undefined' | binary() is not compatible with binary() - because - 'undefined' is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/error_messages.erl:27:32 │ @@ -89,17 +63,9 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/error_messages.erl:30:32 │ 30 │ no_record_conversion_2(Foo) -> Foo. - │ ^^^ - │ │ - │ Foo. + │ ^^^ Foo. Expression has type: #foo{} Context expected type: {binary(), atom(), atom()} - │ - - at tuple index 1: - {'foo', atom(), atom()} is not compatible with {binary(), atom(), atom()} - because - 'foo' is not compatible with binary() error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/error_messages.erl:33:27 @@ -118,13 +84,6 @@ Because in the expression's type: Context expects type: binary() , atom()} ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'foo', atom(), atom()} is not compatible with {'foo', binary(), atom()} - because - atom() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/error_messages.erl:37:31 │ @@ -143,18 +102,6 @@ Because in the expression's type: The expected map has no corresponding key for: large_map_key_a. , ... } ------------------------------- Detailed message ------------------------------ - - #{foo => #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'}} is not compatible with #{foo => #{large_map_key_c => 'large_map_val_c'} | #{large_map_key_d => 'large_map_val_d'}} - because - at key `foo`: - #{foo => #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'}} is not compatible with #{foo => #{large_map_key_c => 'large_map_val_c'} | #{large_map_key_d => 'large_map_val_d'}} - because - #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'} is not compatible with #{large_map_key_c => 'large_map_val_c'} | #{large_map_key_d => 'large_map_val_d'} - because - #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'} is not compatible with #{large_map_key_c => 'large_map_val_c'} - key `large_map_key_a` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/error_messages.erl:41:31 │ @@ -173,16 +120,4 @@ Because in the expression's type: The expected map has no corresponding key for: large_map_key_a. , ... } ------------------------------- Detailed message ------------------------------ - - #{foo => #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'}} is not compatible with #{foo => #{large_map_key_c => 'large_map_val_c', large_map_key_d => 'large_map_val_d'} | 'any'} - because - at key `foo`: - #{foo => #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'}} is not compatible with #{foo => #{large_map_key_c => 'large_map_val_c', large_map_key_d => 'large_map_val_d'} | 'any'} - because - #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'} is not compatible with #{large_map_key_c => 'large_map_val_c', large_map_key_d => 'large_map_val_d'} | 'any' - because - #{large_map_key_a => 'large_map_val_a', large_map_key_b => 'large_map_val_b'} is not compatible with #{large_map_key_c => 'large_map_val_c', large_map_key_d => 'large_map_val_d'} - key `large_map_key_a` is declared in the former but not in the latter and the latter map has no default association - 8 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/format.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/format.pretty index f6d7701c2e..1a6ae465e8 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/format.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/format.pretty @@ -13,10 +13,4 @@ Because in the expression's type: Here the type is: [number() | io_lib:chars()] Context expects type: string() ------------------------------- Detailed message ------------------------------ - - io_lib:chars() is not compatible with string() - because - [number() | io_lib:chars()] is not compatible with string() - 1 ERROR diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/funs.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/funs.pretty index 589448836f..1e2c339ecc 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/funs.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/funs.pretty @@ -29,12 +29,6 @@ Because in the expression's type: Here the type is: number() Context expects type: [term()] ------------------------------- Detailed message ------------------------------ - - n() is not compatible with [term()] - because - number() is not compatible with [term()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:63:9 │ @@ -50,12 +44,6 @@ Because in the expression's type: Here the type is: [dynamic()] Context expects type: number() ------------------------------- Detailed message ------------------------------ - - [dynamic()] is not compatible with n() - because - [dynamic()] is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:70:13 │ @@ -71,12 +59,6 @@ Because in the expression's type: Here the type is: binary() Context expects type: number() ------------------------------- Detailed message ------------------------------ - - binary() is not compatible with n() - because - binary() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:70:35 │ @@ -92,12 +74,6 @@ Because in the expression's type: Here the type is: number() Context expects type: atom() ------------------------------- Detailed message ------------------------------ - - n() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:77:5 │ @@ -116,14 +92,6 @@ Because in the expression's type: Context expects type: 'a' ] ------------------------------- Detailed message ------------------------------ - - [n()] is not compatible with ['a'] - because - n() is not compatible with 'a' - because - number() is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:90:18 │ @@ -139,12 +107,6 @@ Because in the expression's type: Here the type is: number() Context expects type: [term()] ------------------------------- Detailed message ------------------------------ - - n() is not compatible with [term()] - because - number() is not compatible with [term()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:90:18 │ @@ -160,12 +122,6 @@ Because in the expression's type: Here the type is: [dynamic()] Context expects type: number() ------------------------------- Detailed message ------------------------------ - - [dynamic()] is not compatible with n() - because - [dynamic()] is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:90:23 │ @@ -181,12 +137,6 @@ Because in the expression's type: Here the type is: number() Context expects type: [term()] ------------------------------- Detailed message ------------------------------ - - n() is not compatible with [term()] - because - number() is not compatible with [term()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:96:31 │ @@ -202,12 +152,6 @@ Because in the expression's type: Here the type is: number() Context expects type: atom() ------------------------------- Detailed message ------------------------------ - - n() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:97:9 │ @@ -223,12 +167,6 @@ Because in the expression's type: Here the type is: number() Context expects type: [term()] ------------------------------- Detailed message ------------------------------ - - n() is not compatible with [term()] - because - number() is not compatible with [term()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:97:9 │ @@ -244,12 +182,6 @@ Because in the expression's type: Here the type is: [dynamic()] Context expects type: number() ------------------------------- Detailed message ------------------------------ - - [dynamic()] is not compatible with n() - because - [dynamic()] is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:97:14 │ @@ -265,12 +197,6 @@ Because in the expression's type: Here the type is: number() Context expects type: [term()] ------------------------------- Detailed message ------------------------------ - - n() is not compatible with [term()] - because - number() is not compatible with [term()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs.erl:104:7 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/funs2.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/funs2.pretty index 7b20cba52c..f3a82abfd6 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/funs2.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/funs2.pretty @@ -19,14 +19,6 @@ Because in the expression's type: ] ] ------------------------------- Detailed message ------------------------------ - - [[[[]]]] is not compatible with [[[]]] - because - [[[]]] is not compatible with [[]] - because - [[]] is not compatible with [] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs2.erl:54:5 │ @@ -66,12 +58,6 @@ Because in the expression's type: Context expects type: atom() ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((atom()) -> atom()) - because - string() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs2.erl:101:9 │ @@ -90,14 +76,6 @@ Because in the expression's type: Differs from the expected type: atom() ) -> string()) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((dynamic() | fun((string()) -> atom())) -> dynamic() | fun((string()) -> atom())) - because - dynamic() | fun((string()) -> atom()) is not compatible with atom() - because - fun((string()) -> atom()) is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs2.erl:101:9 │ @@ -116,14 +94,6 @@ Because in the expression's type: Differs from the expected type: atom() ) -> string()) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> string()) is not compatible with fun((dynamic() | string() | fun((string()) -> atom())) -> dynamic() | string() | fun((string()) -> atom())) - because - dynamic() | string() | fun((string()) -> atom()) is not compatible with atom() - because - string() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/funs2.erl:152:27 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/generic_fun_application.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/generic_fun_application.pretty index c10af08c9d..ae03bc49c8 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/generic_fun_application.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/generic_fun_application.pretty @@ -31,12 +31,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:38:29 │ @@ -54,14 +48,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [dynamic(atom())] - because - number() is not compatible with dynamic(atom()) - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:43:5 │ @@ -87,12 +73,6 @@ Because in the expression's type: Context expects type: B ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> pid()) is not compatible with fun((number()) -> B) - because - pid() is not compatible with B - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:43:18 │ @@ -111,14 +91,6 @@ Because in the expression's type: Differs from the expected type: atom() ) -> pid()) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> pid()) is not compatible with fun((dynamic() | number()) -> pid()) - because - dynamic() | number() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:47:33 │ @@ -136,12 +108,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:47:33 │ @@ -159,14 +125,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [dynamic(atom())] - because - number() is not compatible with dynamic(atom()) - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:48:5 │ @@ -192,12 +150,6 @@ Because in the expression's type: Context expects type: B ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> pid()) is not compatible with fun((number()) -> B) - because - pid() is not compatible with B - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:52:22 │ @@ -216,14 +168,6 @@ Because in the expression's type: Differs from the expected type: atom() ) -> pid()) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> pid()) is not compatible with fun((dynamic() | number()) -> pid()) - because - dynamic() | number() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:53:5 │ @@ -272,10 +216,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: true. ------------------------------- Detailed message ------------------------------ - -key `true` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:99:13 │ @@ -365,15 +305,6 @@ Because in the expression's type: Context expects type: T , ... } ------------------------------- Detailed message ------------------------------ - - #{a => number()} is not compatible with #{atom() => T} - because - #{a => number()} is not compatible with #{atom() => T} - key `a` is declared in the former but not in the latter and key `a` isn't compatible with the default association of the latter map - because - number() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:126:5 │ @@ -414,12 +345,6 @@ Because in the expression's type: However the following candidate: 'b' Differs from the expected type: 'a' ------------------------------- Detailed message ------------------------------ - - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:157:5 │ @@ -444,12 +369,6 @@ Because in the expression's type: However the following candidate: 'b' Differs from the expected type: 'a' ------------------------------- Detailed message ------------------------------ - - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:172:5 │ @@ -466,12 +385,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: 'b' ------------------------------- Detailed message ------------------------------ - - 'a' | 'b' is not compatible with 'b' - because - 'a' is not compatible with 'b' - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/generic_fun_application.erl:226:1 │ @@ -521,12 +434,6 @@ Because in the expression's type: Context expects type: X ) ------------------------------- Detailed message ------------------------------ - - fun(() -> A) is not compatible with fun(() -> X) - because - A is not compatible with X - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:276:5 │ @@ -567,12 +474,6 @@ Because in the expression's type: However the following candidate: Last Differs from the expected type: 'first' ------------------------------- Detailed message ------------------------------ - - 'first' | Last is not compatible with 'first' - because - Last is not compatible with 'first' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:296:5 │ @@ -589,12 +490,6 @@ Because in the expression's type: However the following candidate: T Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - atom() | T is not compatible with atom() - because - T is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:322:5 │ @@ -612,13 +507,6 @@ Because in the expression's type: Context expects type: pid() , pid()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {number(), pid()} is not compatible with {pid(), number()} - because - number() is not compatible with pid() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:330:5 │ @@ -677,12 +565,6 @@ Because in the expression's type: Context expects type: fun((A) -> A) with 0 type parameters The number of type parameters doesn't match. ------------------------------- Detailed message ------------------------------ - - fun((Z) -> Z) | fun((dynamic()) -> dynamic()) is not compatible with fun((A) -> A) - because - fun((Z) -> Z) with 1 type parameter is not compatible with fun((A) -> A) with 0 type parameters - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:346:9 │ @@ -701,12 +583,6 @@ Because in the expression's type: Context expects type: fun((dynamic()) -> dynamic()) with 0 type parameters The number of type parameters doesn't match. ------------------------------- Detailed message ------------------------------ - - fun((Z) -> Z) | fun((dynamic()) -> dynamic()) is not compatible with fun((dynamic()) -> dynamic()) - because - fun((Z) -> Z) with 1 type parameter is not compatible with fun((dynamic()) -> dynamic()) with 0 type parameters - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:346:9 │ @@ -725,12 +601,6 @@ Because in the expression's type: Context expects type: fun((A) -> A) with 0 type parameters The number of type parameters doesn't match. ------------------------------- Detailed message ------------------------------ - - fun((Z) -> Z) | fun((dynamic()) -> dynamic()) is not compatible with fun((A) -> A) - because - fun((Z) -> Z) with 1 type parameter is not compatible with fun((A) -> A) with 0 type parameters - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:358:9 │ @@ -781,12 +651,6 @@ Because in the expression's type: Context expects type: fun((Z) -> Z) with 0 type parameters The number of type parameters doesn't match. ------------------------------- Detailed message ------------------------------ - - fun((Z) -> Z) | fun((dynamic()) -> dynamic()) is not compatible with fun((Z) -> Z) - because - fun((Z) -> Z) with 1 type parameter is not compatible with fun((Z) -> Z) with 0 type parameters - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:358:9 │ @@ -805,12 +669,6 @@ Because in the expression's type: Context expects type: fun((dynamic()) -> dynamic()) with 0 type parameters The number of type parameters doesn't match. ------------------------------- Detailed message ------------------------------ - - fun((Z) -> Z) | fun((dynamic()) -> dynamic()) is not compatible with fun((dynamic()) -> dynamic()) - because - fun((Z) -> Z) with 1 type parameter is not compatible with fun((dynamic()) -> dynamic()) with 0 type parameters - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:358:9 │ @@ -829,12 +687,6 @@ Because in the expression's type: Context expects type: fun((Z) -> Z) with 0 type parameters The number of type parameters doesn't match. ------------------------------- Detailed message ------------------------------ - - fun((Z) -> Z) | fun((dynamic()) -> dynamic()) is not compatible with fun((Z) -> Z) - because - fun((Z) -> Z) with 1 type parameter is not compatible with fun((Z) -> Z) with 0 type parameters - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:432:18 │ @@ -875,10 +727,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:441:16 │ @@ -895,10 +743,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:446:15 │ @@ -916,12 +760,6 @@ Because in the expression's type: Context expects type: T ) ------------------------------- Detailed message ------------------------------ - - fun((#{a => number()}) -> number()) is not compatible with fun((#{{T} => T}) -> T) - because - number() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:446:15 │ @@ -940,15 +778,6 @@ Because in the expression's type: The expected map has no default association while the type of the expression has one. ) -> number()) ------------------------------- Detailed message ------------------------------ - - fun((#{a => number()}) -> number()) is not compatible with fun((#{{number()} => number()}) -> number()) - because - #{{number()} => number()} is not compatible with #{a => number()} - because - #{{number()} => number()} is not compatible with #{a => number()} - the latter map has no default association while the first map has one - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:471:24 │ @@ -966,12 +795,6 @@ Because in the expression's type: Context expects type: 'c' ) ------------------------------- Detailed message ------------------------------ - - fun(('a') -> 'b') is not compatible with fun(('a') -> 'c') - because - 'b' is not compatible with 'c' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:478:17 │ @@ -988,10 +811,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:478:17 │ @@ -1008,10 +827,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:500:36 │ @@ -1048,16 +863,6 @@ Because in the expression's type: ) -> 'ok') ) -> 'ok') ------------------------------- Detailed message ------------------------------ - - contravar(contravar('a' | 'b')) is not compatible with contravar(contravar('a')) - because - fun((contravar('a' | 'b')) -> 'ok') is not compatible with contravar(contravar('a')) - because - fun((contravar('a' | 'b')) -> 'ok') is not compatible with fun((contravar('a')) -> 'ok') - because - contravar('a') is not compatible with contravar('a' | 'b') - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:563:5 │ @@ -1075,14 +880,6 @@ Because in the expression's type: Context expects type: 'a' ) -> 'a') ------------------------------- Detailed message ------------------------------ - - invar('a') is not compatible with fun((atom()) -> atom()) - because - fun(('a') -> 'a') is not compatible with fun((atom()) -> atom()) - because - atom() is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:569:5 │ @@ -1100,16 +897,6 @@ Because in the expression's type: Context expects type: 'a' ) -> 'a') ------------------------------- Detailed message ------------------------------ - - invar('a') is not compatible with invar(atom()) - because - fun(('a') -> 'a') is not compatible with invar(atom()) - because - fun(('a') -> 'a') is not compatible with fun((atom()) -> atom()) - because - atom() is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:585:5 │ @@ -1125,12 +912,6 @@ Because in the expression's type: Here the type is: 'a' Context expects type: fun(('a') -> 'a') ------------------------------- Detailed message ------------------------------ - - 'a' is not compatible with invar('a') - because - 'a' is not compatible with fun(('a') -> 'a') - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/generic_fun_application.erl:625:1 │ @@ -1175,10 +956,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: extra. ------------------------------- Detailed message ------------------------------ - -key `extra` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:721:25 │ @@ -1205,14 +982,6 @@ Because in the expression's type: Differs from the expected type: 'a' ) -> 'a') ------------------------------- Detailed message ------------------------------ - - fun(('a') -> 'a') is not compatible with fun(('a' | 'b') -> 'a' | 'b') - because - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generic_fun_application.erl:752:32 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/generics_with_unions.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/generics_with_unions.pretty index 53cd1350ec..9c03aa9a60 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/generics_with_unions.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/generics_with_unions.pretty @@ -16,15 +16,6 @@ Because in the expression's type: Differs from the expected type: T , T | U} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {T | U, T | U} is not compatible with {T, U} - because - T | U is not compatible with T - because - U is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generics_with_unions.erl:70:19 │ @@ -62,12 +53,6 @@ Because in the expression's type: Here the type is: [prop('a', number())] Context expects type: 'wrong_ret' ------------------------------- Detailed message ------------------------------ - - props('a', number()) is not compatible with 'wrong_ret' - because - [prop('a', number())] is not compatible with 'wrong_ret' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generics_with_unions.erl:217:19 │ @@ -92,12 +77,6 @@ Because in the expression's type: However the following candidate: [T] Differs from the expected type: T ------------------------------- Detailed message ------------------------------ - - [T] | T is not compatible with T - because - [T] is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generics_with_unions.erl:221:17 │ @@ -114,12 +93,6 @@ Because in the expression's type: However the following candidate: [T] Differs from the expected type: T ------------------------------- Detailed message ------------------------------ - - T | [T] is not compatible with T - because - [T] is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generics_with_unions.erl:222:19 │ @@ -171,14 +144,6 @@ Because in the expression's type: Context expects type: K ] ------------------------------- Detailed message ------------------------------ - - [K] | [[K]] is not compatible with [K] - because - [[K]] is not compatible with [K] - because - [K] is not compatible with K - error: ambiguous_union (See https://fb.me/eqwalizer_errors#ambiguous_union) ┌─ check/src/generics_with_unions.erl:332:31 │ @@ -205,17 +170,6 @@ Because in the expression's type: } ) -> 'ok') ------------------------------- Detailed message ------------------------------ - - query() is not compatible with fun(({'i', 'atom'}) -> 'ok') - because - fun(({'a', atom()} | {'b', binary()} | {'i', number()}) -> 'ok') is not compatible with fun(({'i', 'atom'}) -> 'ok') - because - {'i', 'atom'} is not compatible with {'a', atom()} | {'b', binary()} | {'i', number()} - because - at tuple index 2: - {'i', 'atom'} is not compatible with {'i', number()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/generics_with_unions.erl:392:17 │ @@ -235,15 +189,4 @@ Because in the expression's type: } ) -> 'ok') ------------------------------- Detailed message ------------------------------ - - query() is not compatible with fun(({'a', number()}) -> 'ok') - because - fun(({'a', atom()} | {'b', binary()} | {'i', number()}) -> 'ok') is not compatible with fun(({'a', number()}) -> 'ok') - because - {'a', number()} is not compatible with {'a', atom()} | {'b', binary()} | {'i', number()} - because - at tuple index 2: - {'a', number()} is not compatible with {'a', atom()} - 16 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_bounded.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_bounded.pretty index bbd9109d68..1987f06692 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_bounded.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_bounded.pretty @@ -14,12 +14,6 @@ Because in the expression's type: However the following candidate: 'b' Differs from the expected type: 'c' ------------------------------- Detailed message ------------------------------ - - dyn('a') | 'b' is not compatible with 'c' - because - 'b' is not compatible with 'c' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_bounded.erl:25:26 │ @@ -35,16 +29,6 @@ Because in the expression's type: Here the type is: 'a' Context expects type: 'b' ------------------------------- Detailed message ------------------------------ - - 'a' is not compatible with dyn('b') - because - 'a' is not compatible with dynamic('b') - because - 'a' is not compatible with dynamic('b') - because - 'a' is not compatible with 'b' - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/gradual_bounded.erl:44:27 │ @@ -85,12 +69,6 @@ Because in the expression's type: However the following candidate: 'test' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - 'test' | number() is not compatible with number() - because - 'test' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_bounded.erl:89:5 │ @@ -107,10 +85,4 @@ Because in the expression's type: However the following candidate: 'test' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - 'test' | dyn(number()) is not compatible with number() - because - 'test' is not compatible with number() - 8 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_complex_types.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_complex_types.pretty index b7111f9239..a7a81c8fb4 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_complex_types.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_complex_types.pretty @@ -13,12 +13,6 @@ Because in the expression's type: Here the type is: 'undefined' Context expects type: #{...} ------------------------------- Detailed message ------------------------------ - - 'undefined' is not compatible with complex_map() - because - 'undefined' is not compatible with #{id := number(), {secret, id} => number(), atom() => term()} - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/gradual_complex_types.erl:29:25 │ @@ -46,12 +40,6 @@ Because in the expression's type: Here the type is: #{...} Context expects type: [T] ------------------------------- Detailed message ------------------------------ - - complex_map() is not compatible with [T] - because - #{id := number(), {secret, id} => number(), atom() => term()} is not compatible with [T] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_complex_types.erl:48:16 │ @@ -67,12 +55,6 @@ Because in the expression's type: Here the type is: #{...} Context expects type: [dynamic()] ------------------------------- Detailed message ------------------------------ - - complex_map() is not compatible with [dynamic()] - because - #{id := number(), {secret, id} => number(), atom() => term()} is not compatible with [dynamic()] - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/gradual_complex_types.erl:55:25 │ @@ -110,11 +92,4 @@ Because in the expression's type: Context expects type: number() } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {dyn_map(), 'ok'} is not compatible with {#{a => 'atom'}, number()} - because - 'ok' is not compatible with number() - 9 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_custom.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_custom.pretty index 34e16f1479..065a377d0d 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_custom.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_custom.pretty @@ -100,12 +100,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - dynamic() | 'a' is not compatible with number() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_custom.erl:120:3 │ @@ -202,12 +196,6 @@ Because in the expression's type: Context expects type: 'ok' No candidate of the expression's type matches the expected type. ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with 'ok' - because - string() | binary() is not compatible with 'ok' - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/gradual_custom.erl:210:25 │ @@ -230,12 +218,6 @@ Because in the expression's type: Context expects type: 'ok' No candidate of the expression's type matches the expected type. ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with 'ok' - because - string() | binary() is not compatible with 'ok' - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/gradual_custom.erl:217:25 │ @@ -258,12 +240,6 @@ Because in the expression's type: Context expects type: 'ok' No candidate of the expression's type matches the expected type. ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with 'ok' - because - string() | binary() is not compatible with 'ok' - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/gradual_custom.erl:224:25 │ @@ -286,12 +262,6 @@ Because in the expression's type: Context expects type: 'ok' No candidate of the expression's type matches the expected type. ------------------------------- Detailed message ------------------------------ - - file:filename_all() is not compatible with 'ok' - because - string() | binary() is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_custom.erl:245:19 │ @@ -308,12 +278,6 @@ Because in the expression's type: However the following candidate: 'undefined' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | 'undefined' is not compatible with number() - because - 'undefined' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_custom.erl:257:19 │ @@ -330,12 +294,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | atom() | binary() is not compatible with number() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_custom.erl:263:19 │ @@ -352,12 +310,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | dynamic() | number() | atom() | dynamic() is not compatible with number() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_custom.erl:269:19 │ @@ -374,12 +326,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | dynamic() | atom() | dynamic() is not compatible with number() - because - atom() is not compatible with number() - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/gradual_custom.erl:277:25 │ @@ -402,12 +348,6 @@ Because in the expression's type: However the following candidate: {none()} Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - dynamic() | {none()} is not compatible with number() - because - {none()} is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_custom.erl:325:13 │ @@ -424,14 +364,6 @@ Because in the expression's type: However the following candidate: 'undefined' Differs from the expected type: 'foo' | 'bar' | binary() ------------------------------- Detailed message ------------------------------ - - 'bar' | 'undefined' | 'foo' is not compatible with 'foo' | 'bar' | binary() - because - 'undefined' is not compatible with 'foo' | 'bar' | binary() - because - 'undefined' is not compatible with 'foo' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_custom.erl:343:3 │ @@ -448,10 +380,4 @@ Because in the expression's type: However the following candidate: 'bar' Differs from the expected type: 'foo' ------------------------------- Detailed message ------------------------------ - - 'foo' | 'bar' is not compatible with 'foo' - because - 'bar' is not compatible with 'foo' - 37 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_maybe.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_maybe.pretty index 5587da0d7e..35a509f2f6 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_maybe.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_maybe.pretty @@ -62,14 +62,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: 'b' | 'c' ------------------------------- Detailed message ------------------------------ - - 'a' | 'b' | 'c' is not compatible with 'b' | 'c' - because - 'a' is not compatible with 'b' | 'c' - because - 'a' is not compatible with 'b' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_maybe.erl:147:14 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_misc.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_misc.pretty index 107e1b6e30..28618b5f77 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_misc.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/gradual_misc.pretty @@ -16,16 +16,6 @@ Because in the expression's type: Differs from the expected type: 'a' ) -> 'ok') ------------------------------- Detailed message ------------------------------ - - opaque:contravariant('a') is not compatible with opaque:contravariant('a' | 'b') - because - fun(('a') -> 'ok') is not compatible with opaque:contravariant('a' | 'b') - because - fun(('a') -> 'ok') is not compatible with fun(('a' | 'b') -> 'ok') - because - 'a' | 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/gradual_misc.erl:38:5 │ @@ -45,13 +35,8 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/gradual_misc.erl:46:41 │ 46 │ refine_tuple_neg(T) when is_tuple(T) -> T; - │ ^ - │ │ - │ T. + │ ^ T. Expression has type: {'b', 'c'} Context expected type: 'a' | {none()} - │ - -expected union does not contain any tuple type of size 2 4 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/guard_b_connections.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/guard_b_connections.pretty index 88bcfb1267..74cd6b4ca4 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/guard_b_connections.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/guard_b_connections.pretty @@ -14,14 +14,6 @@ Because in the expression's type: However the following candidate: #r2{} Differs from the expected type: #r1{} ------------------------------- Detailed message ------------------------------ - - #r1{} | #r2{} is not compatible with r1() - because - #r1{} | #r2{} is not compatible with #r1{} - because - #r2{} is not compatible with #r1{} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/guard_b_connections.erl:27:3 │ @@ -38,14 +30,6 @@ Because in the expression's type: However the following candidate: #r2{} Differs from the expected type: #r1{} ------------------------------- Detailed message ------------------------------ - - #r1{} | #r2{} is not compatible with r1() - because - #r1{} | #r2{} is not compatible with #r1{} - because - #r2{} is not compatible with #r1{} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/guard_b_connections.erl:32:3 │ @@ -62,14 +46,6 @@ Because in the expression's type: However the following candidate: #r2{} Differs from the expected type: #r1{} ------------------------------- Detailed message ------------------------------ - - #r1{} | #r2{} is not compatible with r1() - because - #r1{} | #r2{} is not compatible with #r1{} - because - #r2{} is not compatible with #r1{} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/guard_b_connections.erl:38:3 │ @@ -86,14 +62,6 @@ Because in the expression's type: However the following candidate: #r2{} Differs from the expected type: #r1{} ------------------------------- Detailed message ------------------------------ - - #r1{} | #r2{} is not compatible with r1() - because - #r1{} | #r2{} is not compatible with #r1{} - because - #r2{} is not compatible with #r1{} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/guard_b_connections.erl:44:3 │ @@ -110,12 +78,4 @@ Because in the expression's type: However the following candidate: #r2{} Differs from the expected type: #r1{} ------------------------------- Detailed message ------------------------------ - - #r1{} | #r2{} is not compatible with r1() - because - #r1{} | #r2{} is not compatible with #r1{} - because - #r2{} is not compatible with #r1{} - 5 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/guards_logic.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/guards_logic.pretty index c287958c68..bc1b2fff4a 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/guards_logic.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/guards_logic.pretty @@ -30,14 +30,6 @@ Because in the expression's type: However the following candidate: pid() Differs from the expected type: number() | atom() ------------------------------- Detailed message ------------------------------ - - number() | atom() | pid() is not compatible with number() | atom() - because - pid() is not compatible with number() | atom() - because - pid() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/guards_logic.erl:73:5 │ @@ -55,13 +47,6 @@ Because in the expression's type: Context expects type: number() , term()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {term(), term()} is not compatible with {number(), number()} - because - term() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/guards_logic.erl:101:46 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/hints.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/hints.pretty index 2e9f03966d..f990884695 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/hints.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/hints.pretty @@ -38,12 +38,6 @@ Because in the expression's type: However the following candidate: term() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - term() | 'undefined' is not compatible with atom() - because - term() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/hints.erl:52:5 │ @@ -60,12 +54,6 @@ Because in the expression's type: However the following candidate: term() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - term() | 'undefined' is not compatible with atom() - because - term() is not compatible with atom() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/hints.erl:55:1 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/iolists.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/iolists.pretty index bf9d6e219b..00e34f9cb8 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/iolists.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/iolists.pretty @@ -23,14 +23,6 @@ Because in the expression's type: Differs from the expected type: binary() ] ------------------------------- Detailed message ------------------------------ - - [atom() | binary()] is not compatible with [binary()] - because - atom() | binary() is not compatible with binary() - because - atom() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/iolists.erl:55:22 │ @@ -49,14 +41,6 @@ Because in the expression's type: Differs from the expected type: atom() ] ------------------------------- Detailed message ------------------------------ - - [atom() | binary()] is not compatible with [atom()] - because - atom() | binary() is not compatible with atom() - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/iolists.erl:60:27 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/lists_tests.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/lists_tests.pretty index d0768e5669..4b2ec521dd 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/lists_tests.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/lists_tests.pretty @@ -16,16 +16,6 @@ Because in the expression's type: Differs from the expected type: atom() ] ------------------------------- Detailed message ------------------------------ - - [atom() | binary()] is not compatible with [atom()] | [binary()] - because - [atom() | binary()] is not compatible with [atom()] - because - atom() | binary() is not compatible with atom() - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/lists_tests.erl:16:28 │ @@ -44,14 +34,4 @@ Because in the expression's type: Differs from the expected type: atom() ] ------------------------------- Detailed message ------------------------------ - - [atom() | binary()] is not compatible with [atom()] | [binary()] - because - [atom() | binary()] is not compatible with [atom()] - because - atom() | binary() is not compatible with atom() - because - binary() is not compatible with atom() - 2 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/misc.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/misc.pretty index 45a1d69e57..ec963a6249 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/misc.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/misc.pretty @@ -127,12 +127,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:116:21 │ @@ -150,12 +144,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:120:18 │ @@ -207,12 +195,6 @@ Because in the expression's type: Context expects type: number() ] ------------------------------- Detailed message ------------------------------ - - [atom()] is not compatible with [number()] - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:143:29 │ @@ -323,31 +305,17 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/misc.erl:352:22 │ 352 │ catch test69_pos(atom). - │ ^^^^ - │ │ - │ 'atom'. + │ ^^^^ 'atom'. Expression has type: 'atom' Context expected type: [atom()] | [number()] - │ - - 'atom' is not compatible with [atom()] | [number()] - because - 'atom' is not compatible with [atom()] error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:357:22 │ 357 │ catch test69_pos(atom). - │ ^^^^ - │ │ - │ 'atom'. + │ ^^^^ 'atom'. Expression has type: 'atom' Context expected type: [atom()] | [number()] - │ - - 'atom' is not compatible with [atom()] | [number()] - because - 'atom' is not compatible with [atom()] error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:404:11 @@ -393,17 +361,6 @@ Because in the expression's type: ] , [atom() | number()]} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {[number() | atom()], [atom() | number()]} is not compatible with {[atom()], [number()]} - because - [number() | atom()] is not compatible with [atom()] - because - number() | atom() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:461:5 │ @@ -424,17 +381,6 @@ Because in the expression's type: ] , [atom() | number()]} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {[atom() | number()], [atom() | number()]} is not compatible with {[atom()] | [number()], [atom()] | [number()]} - because - [atom() | number()] is not compatible with [atom()] | [number()] - because - [atom() | number()] is not compatible with [atom()] - because - atom() | number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:465:12 │ @@ -509,16 +455,6 @@ Because in the expression's type: Differs from the expected type: atom() | number() ] ------------------------------- Detailed message ------------------------------ - - [atom() | binary()] is not compatible with [atom() | number()] - because - atom() | binary() is not compatible with atom() | number() - because - binary() is not compatible with atom() | number() - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:575:14 │ @@ -552,12 +488,6 @@ Because in the expression's type: Context expects type: [A] ] ------------------------------- Detailed message ------------------------------ - - [A] is not compatible with [[A]] - because - A is not compatible with [A] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:611:21 │ @@ -752,13 +682,6 @@ Because in the expression's type: Context expects type: 'ok' } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {none(), 'err'} is not compatible with {'ok', 'ok'} - because - 'err' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:741:5 │ @@ -775,16 +698,6 @@ Because in the expression's type: However the following candidate: 'v2_op' Differs from the expected type: 'stuff1' | 'v0_op2' | 'stuff2' | 'v0_op1' | 'v1_op2' | ... ------------------------------- Detailed message ------------------------------ - - v2_op() is not compatible with v1_op() - because - 'v2_op' | v1_op() is not compatible with v1_op() - because - 'v2_op' | v1_op() is not compatible with 'v1_op1' | 'v1_op2' | stuff() | v0_op() - because - 'v2_op' is not compatible with 'v1_op1' | 'v1_op2' | stuff() | v0_op() - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ check/src/misc.erl:760:1 │ @@ -834,16 +747,6 @@ Because in the expression's type: Context expects type: #set{} | #{term() => []} No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - misc:set() is not compatible with sets:set() - because - [] is not compatible with sets:set() - because - [] is not compatible with sets:set(term()) - because - [] is not compatible with #set{} | #{term() => []} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:850:5 │ @@ -861,13 +764,6 @@ Because in the expression's type: Context expects type: pid() } ------------------------------- Detailed message ------------------------------ - - at tuple index 3: - {'ok', 'lists', number()} is not compatible with {'ok', atom(), pid()} - because - number() is not compatible with pid() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:860:5 │ @@ -907,12 +803,6 @@ Because in the expression's type: Here the type is: {binary()} Context expects type: [binary()] ------------------------------- Detailed message ------------------------------ - - {binary()} is not compatible with erlang:iovec() - because - {binary()} is not compatible with [binary()] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:949:15 │ @@ -939,14 +829,6 @@ Because in the expression's type: No candidate of the expression's type matches the expected type. ] ------------------------------- Detailed message ------------------------------ - - ['MM' | 'MS' | 'EE' | 'MA' | 'GE'] is not compatible with [erlang:priority_level()] - because - 'MM' | 'MS' | 'EE' | 'MA' | 'GE' is not compatible with erlang:priority_level() - because - 'MM' | 'MS' | 'EE' | 'MA' | 'GE' is not compatible with 'low' | 'normal' | 'high' | 'max' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:971:5 │ @@ -962,12 +844,6 @@ Because in the expression's type: Here the type is: {number(), number(), number()} Context expects type: atom() ------------------------------- Detailed message ------------------------------ - - erlang:timestamp() is not compatible with atom() - because - {number(), number(), number()} is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/misc.erl:987:12 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/neg.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/neg.pretty index 55ce8bf6f5..585b5f8642 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/neg.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/neg.pretty @@ -39,13 +39,6 @@ Because in the expression's type: Context expects type: atom() } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'ok', term()} is not compatible with {atom(), atom()} - because - term() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/neg.erl:27:21 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/numbers.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/numbers.pretty index 8760657fa4..8c78c1ffbe 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/numbers.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/numbers.pretty @@ -150,12 +150,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - 'a' | number() is not compatible with number() - because - 'a' is not compatible with number() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/numbers.erl:538:1 │ @@ -300,13 +294,6 @@ Because in the expression's type: Context expects type: 'ok' } ------------------------------- Detailed message ------------------------------ - - at tuple index 5: - {number(), number(), number(), number(), 'error'} is not compatible with {number(), number(), number(), number(), 'ok'} - because - 'error' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/numbers.erl:658:3 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/opaque.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/opaque.pretty index 765efea8fe..5c207ff164 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/opaque.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/opaque.pretty @@ -16,16 +16,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: {ok, error}. ------------------------------- Detailed message ------------------------------ - - sets:set({'ok', 'error'}) is not compatible with sets:set({'ok', 'ok'}) - because - #set{} | #{{ok, error} => []} is not compatible with sets:set({'ok', 'ok'}) - because - #set{} | #{{ok, error} => []} is not compatible with #set{} | #{{ok, ok} => []} - because - #{{ok, error} => []} is not compatible with #set{} | #{{ok, ok} => []} - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/opaque.erl:29:1 │ @@ -47,12 +37,6 @@ Because in the expression's type: Here the type is: {'ok'} Context expects type: none() ------------------------------- Detailed message ------------------------------ - - misc:o() is not compatible with none() - because - {'ok'} is not compatible with none() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/opaque.erl:86:1 │ @@ -93,14 +77,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: {'ok'} ------------------------------- Detailed message ------------------------------ - - misc:o() | 'a' is not compatible with misc:o() - because - misc:o() | 'a' is not compatible with {'ok'} - because - 'a' is not compatible with {'ok'} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/opaque.erl:135:18 │ @@ -117,14 +93,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: {'ok'} ------------------------------- Detailed message ------------------------------ - - misc:o() | 'a' is not compatible with misc:o() - because - misc:o() | 'a' is not compatible with {'ok'} - because - 'a' is not compatible with {'ok'} - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ check/src/opaque.erl:150:1 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/other.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/other.pretty index b75aabcf84..da1b4e48cb 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/other.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/other.pretty @@ -13,12 +13,6 @@ Because in the expression's type: Here the type is: term() Context expects type: #{...} ------------------------------- Detailed message ------------------------------ - - term() is not compatible with logger:metadata() - because - term() is not compatible with #{domain => [atom()], file => file:filename(), gl => pid(), line => number(), mfa => {atom(), atom(), number()}, pid => pid(), report_cb => logger:report_cb(), time => logger:timestamp(), atom() => term()} - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/other.erl:59:27 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/otp28.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/otp28.pretty index 026d55c435..5113f80c15 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/otp28.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/otp28.pretty @@ -14,14 +14,6 @@ Because in the expression's type: Context expects type: 'ok' | 'error' No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - 'warning' is not compatible with foo() - because - 'warning' is not compatible with 'ok' | 'error' - because - 'warning' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp28.erl:28:5 │ @@ -39,12 +31,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [number()] is not compatible with [atom()] - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp28.erl:40:5 │ @@ -62,12 +48,6 @@ Because in the expression's type: Context expects type: pid() ] ------------------------------- Detailed message ------------------------------ - - [binary()] is not compatible with [pid()] - because - binary() is not compatible with pid() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp28.erl:52:5 │ @@ -95,15 +75,6 @@ Because in the expression's type: } ] ------------------------------- Detailed message ------------------------------ - - [{atom(), binary()}] is not compatible with [{atom(), atom()}] - because - at tuple index 2: - {atom(), binary()} is not compatible with {atom(), atom()} - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp28.erl:68:5 │ @@ -121,13 +92,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{atom() => binary()} is not compatible with #{atom() => atom()} - the default associations are not compatible - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp28.erl:76:5 │ @@ -147,13 +111,4 @@ Because in the expression's type: , atom()} ] ------------------------------- Detailed message ------------------------------ - - [{atom(), binary(), binary(), atom()}] is not compatible with [{atom(), binary(), atom(), binary()}] - because - at tuple index 3: - {atom(), binary(), binary(), atom()} is not compatible with {atom(), binary(), atom(), binary()} - because - binary() is not compatible with atom() - 7 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/otp_opaques.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/otp_opaques.pretty index b41039f95b..59bd5e6099 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/otp_opaques.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/otp_opaques.pretty @@ -17,17 +17,6 @@ Because in the expression's type: , term(), term()} } ------------------------------- Detailed message ------------------------------ - - gb_sets:set(atom()) is not compatible with gb_sets:set(number()) - because - {number(), gb_sets:gb_set_node(atom())} is not compatible with gb_sets:set(number()) - because - at tuple index 2: - {number(), gb_sets:gb_set_node(atom())} is not compatible with {number(), gb_sets:gb_set_node(number())} - because - gb_sets:gb_set_node(atom()) is not compatible with gb_sets:gb_set_node(number()) - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp_opaques.erl:42:5 │ @@ -45,12 +34,6 @@ Because in the expression's type: Context expects type: A ] ------------------------------- Detailed message ------------------------------ - - [[A]] is not compatible with [A] - because - [A] is not compatible with A - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp_opaques.erl:99:17 │ @@ -67,14 +50,6 @@ Because in the expression's type: Context expects type: #set{} | #{a => []} No candidate of the expression's type matches the expected type. ------------------------------- Detailed message ------------------------------ - - maps:iterator('k', 'v') is not compatible with sets:set('a') - because - {'k', 'v', maps:iterator('k', 'v')} | 'none' | [number()] | [['k']] is not compatible with sets:set('a') - because - {'k', 'v', maps:iterator('k', 'v')} | 'none' | [number()] | [['k']] is not compatible with #set{} | #{a => []} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/otp_opaques.erl:102:13 │ @@ -99,14 +74,6 @@ Because in the expression's type: Context expects type: #set{} | #{a => []} No candidate of the expression's type matches the expected type. ------------------------------- Detailed message ------------------------------ - - maps:iterator('k', 'v') is not compatible with sets:set('a') - because - {'k', 'v', maps:iterator('k', 'v')} | 'none' | [number()] | [['k']] is not compatible with sets:set('a') - because - {'k', 'v', maps:iterator('k', 'v')} | 'none' | [number()] | [['k']] is not compatible with #set{} | #{a => []} - error: expected_fun_type (See https://fb.me/eqwalizer_errors#expected_fun_type) ┌─ check/src/otp_opaques.erl:124:5 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded.pretty index 117ed8b349..aa87b295ad 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded.pretty @@ -30,26 +30,13 @@ Because in the expression's type: Context expects type: 'b' ) ------------------------------- Detailed message ------------------------------ - - fun(('a') -> 'z') is not compatible with fun(('a') -> 'b') | fun(('a') -> 'c') - because - fun(('a') -> 'z') is not compatible with fun(('a') -> 'b') - because - 'z' is not compatible with 'b' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/overloaded.erl:126:15 │ 126 │ Res = bar({fun(a) -> a end}), - │ ^^^^^^^^^^^^^^^^^ - │ │ - │ {fun}. + │ ^^^^^^^^^^^^^^^^^ {fun}. Expression has type: {fun((dynamic()) -> dynamic())} Context expected type: fun(('a') -> 'b') | fun(('a') -> 'c') - │ - -expected union does not contain any tuple type of size 1 error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/overloaded.erl:198:37 @@ -107,12 +94,6 @@ Because in the expression's type: However the following candidate: {} Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | {} is not compatible with number() - because - {} is not compatible with number() - error: unbound_type_var (See https://fb.me/eqwalizer_errors#unbound_type_var) ┌─ check/src/overloaded.erl:261:1 │ @@ -130,16 +111,9 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/overloaded.erl:269:14 │ 269 │ _ = swap(""), - │ ^^ - │ │ - │ string_lit. + │ ^^ string_lit. Expression has type: [] Context expected type: atom() | binary() - │ - - [] is not compatible with atom() | binary() - because - [] is not compatible with atom() error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/overloaded.erl:290:5 diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded_specs_union.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded_specs_union.pretty index 3483635724..6687ec3321 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded_specs_union.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/overloaded_specs_union.pretty @@ -14,12 +14,6 @@ Because in the expression's type: However the following candidate: pid() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - atom() | pid() is not compatible with atom() - because - pid() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/overloaded_specs_union.erl:19:29 │ @@ -36,12 +30,4 @@ Because in the expression's type: However the following candidate: pid() Differs from the expected type: atom() | binary() ------------------------------- Detailed message ------------------------------ - - atom() | binary() | pid() is not compatible with atom() | binary() - because - pid() is not compatible with atom() | binary() - because - pid() is not compatible with atom() - 2 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/pats.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/pats.pretty index d0d4f19c1a..171c12dc46 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/pats.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/pats.pretty @@ -14,10 +14,4 @@ Because in the expression's type: However the following candidate: 'error' Differs from the expected type: #{term() => term()} ------------------------------- Detailed message ------------------------------ - - #{a => 'ok'} | 'error' is not compatible with #{term() => term()} - because - 'error' is not compatible with #{term() => term()} - 1 ERROR diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/records.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/records.pretty index 5b6854f238..f59eda6cd2 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/records.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/records.pretty @@ -18,16 +18,9 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ check/src/records.erl:50:21 │ 50 │ mk_rec_neg(rec2) -> #rec2{}. - │ ^^^^^^^ - │ │ - │ #rec2{...}. + │ ^^^^^^^ #rec2{...}. Expression has type: #rec2{} Context expected type: #rec1{} | #rec3{} - │ - - #rec2{} is not compatible with #rec1{} | #rec3{} - because - #rec2{} is not compatible with #rec1{} error: undefined_field (See https://fb.me/eqwalizer_errors#undefined_field) ┌─ check/src/records.erl:59:11 @@ -108,13 +101,6 @@ Because in the expression's type: Context expects type: number() , number()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {atom(), number()} is not compatible with {number(), atom()} - because - atom() is not compatible with number() - error: undefined_field (See https://fb.me/eqwalizer_errors#undefined_field) ┌─ check/src/records.erl:144:17 │ @@ -181,14 +167,6 @@ Because in the expression's type: Context expects type: number() } ------------------------------- Detailed message ------------------------------ - - #any_box{inner :: 'ok'} is not compatible with int_box() - because - #any_box{inner :: 'ok'} is not compatible with #any_box{inner :: number()} - because - 'ok' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:222:5 │ @@ -206,12 +184,6 @@ Because in the expression's type: Context expects type: number() } ------------------------------- Detailed message ------------------------------ - - #any_box{inner :: 'ok'} is not compatible with #any_box{inner :: number()} - because - 'ok' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:282:27 │ @@ -228,12 +200,6 @@ Because in the expression's type: Context expects type: number() | 'false' | 'true' No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - 'a' is not compatible with number() | boolean() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:287:23 │ @@ -250,12 +216,6 @@ Because in the expression's type: Context expects type: number() | 'false' | 'true' No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - 'a' is not compatible with number() | boolean() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:292:5 │ @@ -273,14 +233,6 @@ Because in the expression's type: Context expects type: number() } ------------------------------- Detailed message ------------------------------ - - #int_bool_box{inner :: 'true'} is not compatible with only_int_box() - because - #int_bool_box{inner :: 'true'} is not compatible with #int_bool_box{inner :: number()} - because - 'true' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:308:28 │ @@ -297,12 +249,6 @@ Because in the expression's type: Context expects type: number() | 'false' | 'true' No candidate matches in the expected union. ------------------------------- Detailed message ------------------------------ - - 'a' is not compatible with number() | boolean() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:314:5 │ @@ -320,14 +266,6 @@ Because in the expression's type: Context expects type: boolean() } ------------------------------- Detailed message ------------------------------ - - #int_bool_box{inner :: number()} is not compatible with only_bool_box() - because - #int_bool_box{inner :: number()} is not compatible with #int_bool_box{inner :: boolean()} - because - number() is not compatible with boolean() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:319:5 │ @@ -343,12 +281,6 @@ Because in the expression's type: Here the type is: #int_bool_box{inner :: number()} Context expects type: #any_box{} ------------------------------- Detailed message ------------------------------ - - only_int_box() is not compatible with #any_box{} - because - #int_bool_box{inner :: number()} is not compatible with #any_box{} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:319:5 │ @@ -383,15 +315,6 @@ Because in the expression's type: No candidate matches in the expected union. } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'int_bool_box', 'a'} is not compatible with {'int_bool_box', number() | boolean()} - because - 'a' is not compatible with number() | boolean() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:334:5 │ @@ -409,15 +332,6 @@ Because in the expression's type: Context expects type: number() } ------------------------------- Detailed message ------------------------------ - - {'int_bool_box', 'a'} is not compatible with only_int_box() - because - at tuple index 2: - {'int_bool_box', 'a'} is not compatible with {'int_bool_box', number()} - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:352:5 │ @@ -434,12 +348,6 @@ Because in the expression's type: However the following candidate: 'false' Differs from the expected type: 'true' ------------------------------- Detailed message ------------------------------ - - boolean() | 'true' is not compatible with 'true' - because - 'false' is not compatible with 'true' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:355:13 │ @@ -463,12 +371,6 @@ Because in the expression's type: Here the type is: #bad_default{} Context expects type: #int_bool_box{inner :: number()} ------------------------------- Detailed message ------------------------------ - - #bad_default{} is not compatible with only_int_box() - because - #bad_default{} is not compatible with #int_bool_box{inner :: number()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:372:5 │ @@ -486,13 +388,6 @@ Because in the expression's type: Context expects type: 'bad_default' , number()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {'int_bool_box', number()} is not compatible with {'bad_default', number()} - because - 'int_bool_box' is not compatible with 'bad_default' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:388:31 │ @@ -510,12 +405,6 @@ Because in the expression's type: Context expects type: number() } ------------------------------- Detailed message ------------------------------ - - #refined_two_fields{} is not compatible with #refined_two_fields{inner :: number()} - because - term() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/records.erl:402:5 │ @@ -594,12 +483,6 @@ Because in the expression's type: However the following candidate: 'my_record' Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - 'my_record' | binary() is not compatible with binary() - because - 'my_record' is not compatible with binary() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/records.erl:517:1 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/recursive_aliases.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/recursive_aliases.pretty index 215d6a54ae..ffd83bc179 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/recursive_aliases.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/recursive_aliases.pretty @@ -17,16 +17,6 @@ Because in the expression's type: Context expects type: 'b' , chainA()} ------------------------------- Detailed message ------------------------------ - - chainA() is not compatible with chainB() - because - 'nil' | {'a', chainA()} is not compatible with chainB() - because - 'nil' | {'a', chainA()} is not compatible with 'nil' | {'b', chainB()} - because - {'a', chainA()} is not compatible with 'nil' | {'b', chainB()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/recursive_aliases.erl:62:20 │ @@ -46,16 +36,6 @@ Because in the expression's type: Context expects type: 'a' , chainB()} ------------------------------- Detailed message ------------------------------ - - chainB() is not compatible with chainA() - because - 'nil' | {'b', chainB()} is not compatible with chainA() - because - 'nil' | {'b', chainB()} is not compatible with 'nil' | {'a', chainA()} - because - {'b', chainB()} is not compatible with 'nil' | {'a', chainA()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/recursive_aliases.erl:65:20 │ @@ -75,16 +55,6 @@ Because in the expression's type: Context expects type: 'a' , chainAB()} ------------------------------- Detailed message ------------------------------ - - chainAB() is not compatible with chainA() - because - 'nil' | {'a', chainAB()} | {'b', chainAB()} is not compatible with chainA() - because - 'nil' | {'a', chainAB()} | {'b', chainAB()} is not compatible with 'nil' | {'a', chainA()} - because - {'b', chainAB()} is not compatible with 'nil' | {'a', chainA()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/recursive_aliases.erl:68:20 │ @@ -104,16 +74,6 @@ Because in the expression's type: Context expects type: 'b' , chainAB()} ------------------------------- Detailed message ------------------------------ - - chainAB() is not compatible with chainB() - because - 'nil' | {'a', chainAB()} | {'b', chainAB()} is not compatible with chainB() - because - 'nil' | {'a', chainAB()} | {'b', chainAB()} is not compatible with 'nil' | {'b', chainB()} - because - {'a', chainAB()} is not compatible with 'nil' | {'b', chainB()} - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ check/src/recursive_aliases.erl:70:1 │ @@ -143,17 +103,6 @@ Because in the expression's type: However the following candidate: {'a', atom(), pchainA(atom())} Differs from the expected type: 'nil' | {'a', pchainAB(atom())} | {'b', pchainAB(atom())} ------------------------------- Detailed message ------------------------------ - - pchainA(atom()) is not compatible with pchainAB(atom()) - because - 'nil' | {'a', atom(), pchainA(atom())} is not compatible with pchainAB(atom()) - because - 'nil' | {'a', atom(), pchainA(atom())} is not compatible with 'nil' | {'a', pchainAB(atom())} | {'b', pchainAB(atom())} - because - {'a', atom(), pchainA(atom())} is not compatible with 'nil' | {'a', pchainAB(atom())} | {'b', pchainAB(atom())} - expected union does not contain any tuple type of size 3 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/recursive_aliases.erl:113:23 │ @@ -172,16 +121,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - - mChainB() is not compatible with mChainA() - because - 'nil' | #{b := mChainB()} is not compatible with mChainA() - because - 'nil' | #{b := mChainB()} is not compatible with 'nil' | #{a := mChainA()} - because - #{b := mChainB()} is not compatible with 'nil' | #{a := mChainA()} - error: expected_fun_type (See https://fb.me/eqwalizer_errors#expected_fun_type) ┌─ check/src/recursive_aliases.erl:138:15 │ @@ -210,16 +149,6 @@ Because in the expression's type: No candidate matches in the expected union. , pchainA('a')} ------------------------------- Detailed message ------------------------------ - - pchainA('a') is not compatible with pchainA('b' | 'c') - because - 'nil' | {'a', 'a', pchainA('a')} is not compatible with pchainA('b' | 'c') - because - 'nil' | {'a', 'a', pchainA('a')} is not compatible with 'nil' | {'a', 'b' | 'c', pchainA('b' | 'c')} - because - {'a', 'a', pchainA('a')} is not compatible with 'nil' | {'a', 'b' | 'c', pchainA('b' | 'c')} - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ check/src/recursive_aliases.erl:202:1 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/refine.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/refine.pretty index b443f787c6..711e1dc2e9 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/refine.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/refine.pretty @@ -23,13 +23,6 @@ Because in the expression's type: Context expects type: none() , A} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {B, A} is not compatible with {none(), none()} - because - B is not compatible with none() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:22:15 │ @@ -55,12 +48,6 @@ Because in the expression's type: Context expects type: none() ) ------------------------------- Detailed message ------------------------------ - - fun((B | A) -> A) is not compatible with fun((A | B) -> none()) - because - A is not compatible with none() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:34:16 │ @@ -78,12 +65,6 @@ Because in the expression's type: Context expects type: none() ) ------------------------------- Detailed message ------------------------------ - - fun((atom() | A) -> A) is not compatible with fun((A | atom()) -> none()) - because - A is not compatible with none() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:84:27 │ @@ -133,13 +114,6 @@ Because in the expression's type: Context expects type: none() , binary()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {number(), binary()} is not compatible with {none(), none()} - because - number() is not compatible with none() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:126:32 │ @@ -157,13 +131,6 @@ Because in the expression's type: Context expects type: none() , atom()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {number(), atom()} is not compatible with {none(), none()} - because - number() is not compatible with none() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:139:28 │ @@ -190,14 +157,6 @@ Because in the expression's type: Differs from the expected type: 'a' ] ------------------------------- Detailed message ------------------------------ - - ['a' | 'b'] is not compatible with ['a'] - because - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:151:28 │ @@ -224,14 +183,6 @@ Because in the expression's type: Differs from the expected type: 'a' ] ------------------------------- Detailed message ------------------------------ - - ['a' | 'b'] is not compatible with ['a'] - because - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:166:5 │ @@ -273,13 +224,6 @@ Because in the expression's type: Context expects type: 'not_my_rec' , number(), atom()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {'my_rec', number(), atom()} is not compatible with {'not_my_rec', term(), term()} - because - 'my_rec' is not compatible with 'not_my_rec' - error: unknown_id (See https://fb.me/eqwalizer_errors#unknown_id) ┌─ check/src/refine.erl:199:10 │ @@ -310,13 +254,6 @@ Because in the expression's type: Context expects type: number() , number()} ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'my_rec', atom(), number()} is not compatible with {'my_rec', number(), atom()} - because - atom() is not compatible with number() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/refine.erl:218:1 │ @@ -374,13 +311,6 @@ Because in the expression's type: Context expects type: number() , number()} ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'my_rec', atom(), number()} is not compatible with {'my_rec', number(), atom()} - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:250:26 │ @@ -398,15 +328,6 @@ Because in the expression's type: Context expects type: number() , number()} ------------------------------- Detailed message ------------------------------ - - {'my_rec', atom(), number()} is not compatible with dynamic(#my_rec{}) - because - at tuple index 2: - {'my_rec', atom(), number()} is not compatible with {'my_rec', number(), atom()} - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:262:26 │ @@ -424,13 +345,6 @@ Because in the expression's type: Context expects type: atom() , atom()} ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'my_rec', number(), atom()} is not compatible with {'my_rec', atom(), number()} - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:262:26 │ @@ -448,15 +362,6 @@ Because in the expression's type: Context expects type: atom() , atom()} ------------------------------- Detailed message ------------------------------ - - #my_rec{} is not compatible with dynamic({'my_rec', atom(), number()}) - because - at tuple index 2: - {'my_rec', number(), atom()} is not compatible with {'my_rec', atom(), number()} - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:278:21 │ @@ -474,13 +379,6 @@ Because in the expression's type: Context expects type: atom() , atom()} ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'my_rec', number(), atom()} is not compatible with {'my_rec', atom(), atom()} - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:282:16 │ @@ -497,12 +395,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - atom() | number() is not compatible with number() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:286:13 │ @@ -519,12 +411,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: {'my_rec', term(), term()} ------------------------------- Detailed message ------------------------------ - - #my_rec{} | 'a' is not compatible with {'my_rec', term(), term()} - because - 'a' is not compatible with {'my_rec', term(), term()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/refine.erl:296:5 │ @@ -541,12 +427,6 @@ Because in the expression's type: However the following candidate: 'undefined' Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - 'undefined' | binary() is not compatible with binary() - because - 'undefined' is not compatible with binary() - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/refine.erl:378:27 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/strict_complex_types.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/strict_complex_types.pretty index cc9f9d0634..8943deb90a 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/strict_complex_types.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/strict_complex_types.pretty @@ -13,12 +13,6 @@ Because in the expression's type: Here the type is: 'undefined' Context expects type: #{...} ------------------------------- Detailed message ------------------------------ - - 'undefined' is not compatible with complex_map() - because - 'undefined' is not compatible with #{id := number(), {secret, id} => number(), atom() => term()} - error: reveal_type (See https://fb.me/eqwalizer_errors#reveal_type) ┌─ check/src/strict_complex_types.erl:29:25 │ @@ -46,12 +40,6 @@ Because in the expression's type: Here the type is: #{...} Context expects type: [T] ------------------------------- Detailed message ------------------------------ - - complex_map() is not compatible with [T] - because - #{id := number(), {secret, id} => number(), atom() => term()} is not compatible with [T] - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/strict_complex_types.erl:48:16 │ @@ -67,10 +55,4 @@ Because in the expression's type: Here the type is: #{...} Context expects type: [dynamic()] ------------------------------- Detailed message ------------------------------ - - complex_map() is not compatible with [dynamic()] - because - #{id := number(), {secret, id} => number(), atom() => term()} is not compatible with [dynamic()] - 5 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/subtype_neg.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/subtype_neg.pretty index 1ee53764d2..4413a8fee8 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/subtype_neg.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/subtype_neg.pretty @@ -31,12 +31,6 @@ Because in the expression's type: Context expects type: atom() ) ------------------------------- Detailed message ------------------------------ - - fun((atom()) -> term()) is not compatible with fun((term()) -> atom()) - because - term() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:27:11 │ @@ -53,14 +47,6 @@ Because in the expression's type: However the following candidate: 'c' Differs from the expected type: 'a' | 'b' ------------------------------- Detailed message ------------------------------ - - 'a' | 'b' | 'c' is not compatible with 'a' | 'b' - because - 'c' is not compatible with 'a' | 'b' - because - 'c' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:30:11 │ @@ -87,17 +73,6 @@ Because in the expression's type: Differs from the expected type: 'a' , 'a' | 'b'} ------------------------------- Detailed message ------------------------------ - - {'a' | 'b', 'a' | 'b'} is not compatible with {'a', 'b'} | {'b', 'a'} - because - at tuple index 1: - {'a' | 'b', 'a' | 'b'} is not compatible with {'a', 'b'} - because - 'a' | 'b' is not compatible with 'a' - because - 'b' is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:38:11 │ @@ -116,17 +91,6 @@ Because in the expression's type: Differs from the expected type: 'a' , ab()} ------------------------------- Detailed message ------------------------------ - - pair_ab() is not compatible with pair_diff_elems() - because - {ab(), ab()} is not compatible with pair_diff_elems() - because - {ab(), ab()} is not compatible with {'a', 'b'} | {'b', 'a'} - because - at tuple index 1: - {ab(), ab()} is not compatible with {'a', 'b'} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:41:11 │ @@ -151,10 +115,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:52:13 │ @@ -171,10 +131,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:60:13 │ @@ -191,10 +147,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:64:13 │ @@ -212,13 +164,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{term() => number()} is not compatible with #{atom() => number()} - the default associations are not compatible - because - term() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:68:13 │ @@ -236,13 +181,6 @@ Because in the expression's type: Context expects type: number() , ... } ------------------------------- Detailed message ------------------------------ - - #{atom() => term()} is not compatible with #{atom() => number()} - the default associations are not compatible - because - term() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:72:13 │ @@ -259,13 +197,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{atom() => term()} is not compatible with #{} - because - #{atom() => term()} is not compatible with #{} - the latter map has no default association while the first map has one - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:79:15 │ @@ -291,13 +222,6 @@ Because in the expression's type: Context expects type: 'ok' } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {{}, 'error'} is not compatible with {tuple(), 'ok'} - because - 'error' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:87:5 │ @@ -315,13 +239,6 @@ Because in the expression's type: Context expects type: 'ok' } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {[], 'error'} is not compatible with {[pid()], 'ok'} - because - 'error' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:91:5 │ @@ -339,13 +256,6 @@ Because in the expression's type: Context expects type: 'ok' } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {[], 'error'} is not compatible with {iolist(), 'ok'} - because - 'error' is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/subtype_neg.erl:94:13 │ @@ -382,10 +292,4 @@ Because in the expression's type: Context expects type: none() ] ------------------------------- Detailed message ------------------------------ - - ['a'] | [none()] is not compatible with [] - because - ['a'] is not compatible with [] - 20 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/t_maps.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/t_maps.pretty index d0e08f9ac4..5c2b07ae96 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/t_maps.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/t_maps.pretty @@ -15,13 +15,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{number() => number()} is not compatible with #{number() => atom()} - the default associations are not compatible - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:41:5 │ @@ -40,15 +33,6 @@ Because in the expression's type: Differs from the expected type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{number() => 'zero' | number()} is not compatible with #{number() => atom()} - the default associations are not compatible - because - 'zero' | number() is not compatible with atom() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:56:5 │ @@ -66,15 +50,6 @@ Because in the expression's type: Context expects type: number() , ... } ------------------------------- Detailed message ------------------------------ - - #{one := 'one', zero := number()} is not compatible with #{one => number(), zero := number()} - because - at key `one`: - #{one := 'one', zero := number()} is not compatible with #{one => number(), zero := number()} - because - 'one' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:80:5 │ @@ -108,15 +83,6 @@ Because in the expression's type: Context expects type: n() , ... } ------------------------------- Detailed message ------------------------------ - - #{b() => term()} is not compatible with #{n() => term()} - the default associations are not compatible - because - b() is not compatible with n() - because - boolean() is not compatible with n() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:140:26 │ @@ -134,17 +100,6 @@ Because in the expression's type: Context expects type: n() , ... } ------------------------------- Detailed message ------------------------------ - - #{a := b()} is not compatible with #{a := n()} - because - at key `a`: - #{a := b()} is not compatible with #{a := n()} - because - b() is not compatible with n() - because - boolean() is not compatible with n() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:145:26 │ @@ -162,17 +117,6 @@ Because in the expression's type: Context expects type: n() , ... } ------------------------------- Detailed message ------------------------------ - - #{a := b()} is not compatible with #{a => n()} - because - at key `a`: - #{a := b()} is not compatible with #{a => n()} - because - b() is not compatible with n() - because - boolean() is not compatible with n() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:155:26 │ @@ -189,10 +133,6 @@ Because in the expression's type: Context expects type: #{a := ..., ...} The type of the expression is missing the following required keys: a. ------------------------------- Detailed message ------------------------------ - -key `a` is declared as required in the latter but not in the former - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/t_maps.erl:165:1 │ @@ -216,17 +156,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{a := a(), n() => a()} is not compatible with #{a() => a()} - the default associations are not compatible - because - n() is not compatible with a() - because - number() is not compatible with a() - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:208:5 │ @@ -244,17 +173,6 @@ Because in the expression's type: Context expects type: number() , ... } ------------------------------- Detailed message ------------------------------ - - #{a := a(), n() => a()} is not compatible with #{n() => a()} - because - #{a := a(), n() => a()} is not compatible with #{n() => a()} - key `a` is declared in the former but not in the latter and key `a` isn't compatible with the default association of the latter map - because - 'a' is not compatible with n() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:216:5 │ @@ -272,17 +190,6 @@ Because in the expression's type: Context expects type: number() , ... } ------------------------------- Detailed message ------------------------------ - - #{a := a(), n() => a()} is not compatible with #{n() => a()} - because - #{a := a(), n() => a()} is not compatible with #{n() => a()} - key `a` is declared in the former but not in the latter and key `a` isn't compatible with the default association of the latter map - because - 'a' is not compatible with n() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:224:5 │ @@ -300,17 +207,6 @@ Because in the expression's type: Context expects type: number() , ... } ------------------------------- Detailed message ------------------------------ - - #{a => a(), n() => a()} is not compatible with #{n() => a()} - because - #{a => a(), n() => a()} is not compatible with #{n() => a()} - key `a` is declared in the former but not in the latter and key `a` isn't compatible with the default association of the latter map - because - 'a' is not compatible with n() - because - 'a' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:242:5 │ @@ -328,17 +224,6 @@ Because in the expression's type: Context expects type: F1 , ... } ------------------------------- Detailed message ------------------------------ - - #{bar := B1, foo := F1} is not compatible with foo_bar(B1, F1) - because - #{bar := B1, foo := F1} is not compatible with #{bar := F1, foo := B1} - because - at key `bar`: - #{bar := B1, foo := F1} is not compatible with #{bar := F1, foo := B1} - because - B1 is not compatible with F1 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:254:5 │ @@ -356,17 +241,6 @@ Because in the expression's type: Context expects type: F1 , ... } ------------------------------- Detailed message ------------------------------ - - #{bar := B1, foo := F1} is not compatible with foo_bar_opt(B1, F1) - because - #{bar := B1, foo := F1} is not compatible with #{bar => F1, foo => B1} - because - at key `bar`: - #{bar := B1, foo := F1} is not compatible with #{bar => F1, foo => B1} - because - B1 is not compatible with F1 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:266:5 │ @@ -385,17 +259,6 @@ Because in the expression's type: Differs from the expected type: K1 | K2 , ... } ------------------------------- Detailed message ------------------------------ - - #{K1 | V2 => V1 | K2} is not compatible with kv(K1 | K2, V1 | V2) - because - #{K1 | V2 => V1 | K2} is not compatible with #{K1 | K2 => V1 | V2} - the default associations are not compatible - because - K1 | V2 is not compatible with K1 | K2 - because - V2 is not compatible with K1 | K2 - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:283:19 │ @@ -412,10 +275,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:307:22 │ @@ -433,17 +292,6 @@ Because in the expression's type: Context expects type: number() , n()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {a(), n()} is not compatible with {n(), a()} - because - a() is not compatible with n() - because - atom() is not compatible with n() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:321:5 │ @@ -461,17 +309,6 @@ Because in the expression's type: Context expects type: number() , n()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {a(), n()} is not compatible with {n(), a()} - because - a() is not compatible with n() - because - atom() is not compatible with n() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:334:25 │ @@ -489,13 +326,6 @@ Because in the expression's type: Context expects type: K , ... } ------------------------------- Detailed message ------------------------------ - - #{V => K} is not compatible with #{K => V} - the default associations are not compatible - because - V is not compatible with K - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:351:25 │ @@ -515,17 +345,6 @@ Because in the expression's type: Context expects type: atom() , ... } ------------------------------- Detailed message ------------------------------ - - #{a() => n()} | #{n() => a()} | #{id => 'id' | 'no_id'} is not compatible with #{a() | n() => a()} - because - #{a() => n()} is not compatible with #{a() | n() => a()} - the default associations are not compatible - because - n() is not compatible with a() - because - number() is not compatible with a() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/t_maps.erl:356:1 │ @@ -556,15 +375,6 @@ Because in the expression's type: No candidate of the expression's type matches the expected type. , a()} ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {'a' | 'b', a()} is not compatible with {n(), a()} - because - 'a' | 'b' is not compatible with n() - because - 'a' | 'b' is not compatible with number() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ check/src/t_maps.erl:429:1 │ @@ -611,10 +421,6 @@ Because in the expression's type: Context expects type: #{n := ..., ...} The type of the expression is missing the following required keys: n. ------------------------------- Detailed message ------------------------------ - -key `n` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:536:5 │ @@ -633,17 +439,6 @@ Because in the expression's type: Differs from the expected type: 'b' | 'c' , ... } ------------------------------- Detailed message ------------------------------ - - #{a => 'b' | 'c' | 'a'} is not compatible with #{a => 'b' | 'c'} - because - at key `a`: - #{a => 'b' | 'c' | 'a'} is not compatible with #{a => 'b' | 'c'} - because - 'b' | 'c' | 'a' is not compatible with 'b' | 'c' - because - 'a' is not compatible with 'b' | 'c' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:571:5 │ @@ -660,15 +455,6 @@ Because in the expression's type: Context expects type: #{item_v2 := ..., ...} The type of the expression is missing the following required keys: item_v2. ------------------------------- Detailed message ------------------------------ - - rec_shape() is not compatible with rec_shape_v2() - because - #{item := rec_shape() | 'undefined'} is not compatible with rec_shape_v2() - because - #{item := rec_shape() | 'undefined'} is not compatible with #{item_v2 := rec_shape_v2() | 'undefined'} - key `item_v2` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:629:5 │ @@ -687,14 +473,6 @@ Because in the expression's type: Differs from the expected type: 'a' | #{item := 'a' | gen_shape('a')} , ... } ------------------------------- Detailed message ------------------------------ - - gen_shape('a' | 'b') is not compatible with 'a' | #{item := 'a' | #{item := 'a' | gen_shape('a')}} - because - #{item := 'a' | 'b' | gen_shape('a' | 'b')} is not compatible with 'a' | #{item := 'a' | #{item := 'a' | gen_shape('a')}} - because - #{item := 'a' | 'b' | gen_shape('a' | 'b')} is not compatible with 'a' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:641:5 │ @@ -711,15 +489,6 @@ Because in the expression's type: Context expects type: #{item := ..., ...} The type of the expression is missing the following required keys: item. ------------------------------- Detailed message ------------------------------ - - gen_shape_v2('a') is not compatible with gen_shape('a') - because - #{item_v2 := 'a' | gen_shape_v2('a')} is not compatible with gen_shape('a') - because - #{item_v2 := 'a' | gen_shape_v2('a')} is not compatible with #{item := 'a' | gen_shape('a')} - key `item` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:648:5 │ @@ -736,10 +505,6 @@ Because in the expression's type: Context expects type: #{...} The expected map has no corresponding key for: d. ------------------------------- Detailed message ------------------------------ - -key `d` is declared in the former but not in the latter and the latter map has no default association - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:661:5 │ @@ -757,15 +522,6 @@ Because in the expression's type: Context expects type: 'ka' , ... } ------------------------------- Detailed message ------------------------------ - - #{a => 'va', b => 'vb', c => 'vc', d => 'vd', e => 've'} is not compatible with #{a => 'ka', b => 'kb', c => 'kc'} - because - at key `a`: - #{a => 'va', b => 'vb', c => 'vc', d => 'vd', e => 've'} is not compatible with #{a => 'ka', b => 'kb', c => 'kc'} - because - 'va' is not compatible with 'ka' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:675:5 │ @@ -782,10 +538,6 @@ Because in the expression's type: Context expects type: #{c := ..., ...} The type of the expression is missing the following required keys: c. ------------------------------- Detailed message ------------------------------ - -key `c` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:682:5 │ @@ -802,10 +554,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:689:5 │ @@ -822,10 +570,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:710:5 │ @@ -842,10 +586,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:732:27 │ @@ -862,13 +602,6 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{'a' | 'b' => boolean()} is not compatible with #{a => 'true', b => boolean()} - key a is not present in the former map but is incompatible with its default association - because - boolean() is not compatible with 'true' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:737:27 │ @@ -885,10 +618,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/t_maps.erl:742:27 │ @@ -905,11 +634,4 @@ Because in the expression's type: Context expects type: #{...} (no default association) The expected map has no default association while the type of the expression has one. ------------------------------- Detailed message ------------------------------ - - #{'a' | 'b' => boolean()} is not compatible with #{a => boolean()} - because - #{'a' | 'b' => boolean()} is not compatible with #{a => boolean()} - the latter map has no default association while the first map has one - 44 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/tries.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/tries.pretty index 471b5c8ebe..5f9c8914f4 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/tries.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/tries.pretty @@ -22,12 +22,6 @@ Because in the expression's type: However the following candidate: [] Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - [] | 'error' is not compatible with atom() - because - [] is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/tries.erl:75:16 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/tuple_union.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/tuple_union.pretty index e02af30869..5b2cca1631 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/tuple_union.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/tuple_union.pretty @@ -16,17 +16,6 @@ Because in the expression's type: Differs from the expected type: 'ok' , 'arg' | 'nil'} ------------------------------- Detailed message ------------------------------ - - t4() is not compatible with t5() - because - {'msg', 'ok' | 'err', 'arg' | 'nil'} is not compatible with t5() - because - {'msg', 'ok' | 'err', 'arg' | 'nil'} is not compatible with {'msg', 'ok', 'arg'} | {'msg', 'err', 'arg'} | {'msg', 'ok', 'nil'} | {'msg', 'err', 'nil'} - because - at tuple index 2: - {'msg', 'ok' | 'err', 'arg' | 'nil'} is not compatible with {'msg', 'ok', 'arg'} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/tuple_union.erl:66:26 │ @@ -47,14 +36,4 @@ Because in the expression's type: No candidate of the expression's type matches the expected type. , tree2()} ------------------------------- Detailed message ------------------------------ - - tree3() is not compatible with tree1() - because - {'leaf', atom()} | {'b1' | 'b2' | 'b3', tree2()} is not compatible with tree1() - because - {'leaf', atom()} | {'b1' | 'b2' | 'b3', tree2()} is not compatible with {'leaf', atom()} | {'b1', tree1()} | {'b2', tree1()} - because - {'b1' | 'b2' | 'b3', tree2()} is not compatible with {'leaf', atom()} | {'b1', tree1()} | {'b2', tree1()} - 2 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/type_asserts.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/type_asserts.pretty index c5fb63ed41..069950f003 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/type_asserts.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/type_asserts.pretty @@ -22,12 +22,6 @@ Because in the expression's type: However the following candidate: string() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - string() | binary() is not compatible with binary() - because - string() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/type_asserts.erl:63:26 │ @@ -63,17 +57,6 @@ Because in the expression's type: Context expects type: atom() , atom()} ------------------------------- Detailed message ------------------------------ - - 'false' | {number(), atom()} is not compatible with 'false' | {atom(), number()} - because - {number(), atom()} is not compatible with 'false' | {atom(), number()} - because - at tuple index 1: - {number(), atom()} is not compatible with {atom(), number()} - because - number() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/type_asserts.erl:92:3 │ @@ -91,13 +74,6 @@ Because in the expression's type: Context expects type: number() } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'false' | number(), term()} is not compatible with {'false' | number(), number()} - because - term() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/type_asserts.erl:105:39 │ @@ -150,17 +126,6 @@ Because in the expression's type: The expected map has no corresponding key for: kb. , ... } ------------------------------- Detailed message ------------------------------ - - #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} is not compatible with #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'}} | #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} | #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} - because - #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} is not compatible with #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'}} - the default associations are not compatible - because - #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'} is not compatible with #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'} - because - #{ka := 'va', kb := 'vb', kc := 'vc'} is not compatible with #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/type_asserts.erl:129:9 │ @@ -179,17 +144,6 @@ Because in the expression's type: The expected map has no corresponding key for: kb. , ... } ------------------------------- Detailed message ------------------------------ - - #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} is not compatible with #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'}} | #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} | #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} - because - #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} is not compatible with #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'}} - the default associations are not compatible - because - #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'} is not compatible with #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'} - because - #{ka := 'va', kb := 'vb', kc := 'vc'} is not compatible with #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/type_asserts.erl:132:9 │ @@ -208,17 +162,6 @@ Because in the expression's type: The expected map has no corresponding key for: kb. , ... } ------------------------------- Detailed message ------------------------------ - - #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} is not compatible with #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'}} | #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} | #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} - because - #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'}} is not compatible with #{dynamic() => #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'}} - the default associations are not compatible - because - #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kb := 'vb', kc := 'vc'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb', kc := 'vc'} | #{kb := 'vb'} is not compatible with #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'} - because - #{ka := 'va', kb := 'vb', kc := 'vc'} is not compatible with #{kc := 'vc'} | #{ka := 'va'} | #{ka := 'va', kc := 'vc'} | #{ka := 'va', kb := 'vb'} | #{kb := 'vb'} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ check/src/type_asserts.erl:156:24 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_gradual.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_gradual.pretty index d03afc8cf8..b0892292bd 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_gradual.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_gradual.pretty @@ -15,11 +15,4 @@ Because in the expression's type: Context expects type: atom() } ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {binary()} is not compatible with {atom()} - because - binary() is not compatible with atom() - 1 ERROR diff --git a/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_strict.pretty b/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_strict.pretty index 12f1d81948..034dbd779d 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_strict.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/check/use_dynamic_strict.pretty @@ -15,11 +15,4 @@ Because in the expression's type: Context expects type: atom() } ------------------------------- Detailed message ------------------------------ - - at tuple index 1: - {binary()} is not compatible with {atom()} - because - binary() is not compatible with atom() - 1 ERROR diff --git a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater.pretty b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater.pretty index ab0cebee3f..3c6de10f94 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater.pretty @@ -14,12 +14,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - number() | binary() is not compatible with binary() - because - number() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:172:22 │ @@ -36,12 +30,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - number() | binary() is not compatible with binary() - because - number() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:183:7 │ @@ -58,12 +46,6 @@ Because in the expression's type: However the following candidate: number() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - number() | binary() is not compatible with binary() - because - number() is not compatible with binary() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ eqwater/src/eqwater.erl:228:1 │ @@ -86,12 +68,6 @@ Because in the expression's type: However the following candidate: #ab_rec{} Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - #ab_rec{} | atom() is not compatible with atom() - because - #ab_rec{} is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:356:16 │ @@ -108,12 +84,6 @@ Because in the expression's type: However the following candidate: #ab_rec{} Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - #ab_rec{} | atom() is not compatible with atom() - because - #ab_rec{} is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:404:25 │ @@ -152,12 +122,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | atom() is not compatible with number() - because - atom() is not compatible with number() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ eqwater/src/eqwater.erl:419:1 │ @@ -182,12 +146,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | atom() is not compatible with number() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:429:25 │ @@ -204,12 +162,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | atom() is not compatible with number() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:496:3 │ @@ -235,13 +187,6 @@ Because in the expression's type: Context expects type: atom() } ------------------------------- Detailed message ------------------------------ - - at tuple index 2: - {'union_field', binary()} is not compatible with {'union_field', atom()} - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:559:50 │ @@ -258,12 +203,6 @@ Because in the expression's type: However the following candidate: 'ok' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | 'ok' is not compatible with number() - because - 'ok' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:590:8 │ @@ -280,12 +219,6 @@ Because in the expression's type: However the following candidate: #c{} Differs from the expected type: #b{} ------------------------------- Detailed message ------------------------------ - - #b{} | #c{} is not compatible with #b{} - because - #c{} is not compatible with #b{} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:631:27 │ @@ -302,12 +235,6 @@ Because in the expression's type: However the following candidate: A Differs from the expected type: B ------------------------------- Detailed message ------------------------------ - - A | B is not compatible with B - because - A is not compatible with B - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:649:17 │ @@ -324,12 +251,6 @@ Because in the expression's type: However the following candidate: fun() Differs from the expected type: {term()} ------------------------------- Detailed message ------------------------------ - - fun() | {term()} is not compatible with {term()} - because - fun() is not compatible with {term()} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:660:17 │ @@ -346,12 +267,6 @@ Because in the expression's type: However the following candidate: tuple() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - tuple() | atom() is not compatible with atom() - because - tuple() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:839:27 │ @@ -368,12 +283,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | atom() is not compatible with number() - because - atom() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:997:31 │ @@ -412,12 +321,6 @@ Because in the expression's type: However the following candidate: 'undefined' Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - number() | 'undefined' is not compatible with number() - because - 'undefined' is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1122:14 │ @@ -437,14 +340,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [[atom()]] | [atom()] is not compatible with [atom()] - because - [[atom()]] is not compatible with [atom()] - because - [atom()] is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1131:15 │ @@ -464,14 +359,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [[atom()]] | [atom()] is not compatible with [atom()] - because - [[atom()]] is not compatible with [atom()] - because - [atom()] is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1155:7 │ @@ -488,12 +375,6 @@ Because in the expression's type: However the following candidate: string() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - binary() | string() is not compatible with binary() - because - string() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1181:7 │ @@ -510,12 +391,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - binary() | atom() is not compatible with binary() - because - atom() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1189:60 │ @@ -532,12 +407,6 @@ Because in the expression's type: However the following candidate: 'ok' Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - 'ok' | binary() is not compatible with binary() - because - 'ok' is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1194:30 │ @@ -554,12 +423,6 @@ Because in the expression's type: However the following candidate: binary() Differs from the expected type: 'ok' ------------------------------- Detailed message ------------------------------ - - binary() | 'ok' is not compatible with 'ok' - because - binary() is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1225:14 │ @@ -576,12 +439,6 @@ Because in the expression's type: However the following candidate: {term(), my_list()} Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - {term(), my_list()} | number() is not compatible with number() - because - {term(), my_list()} is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1231:31 │ @@ -606,12 +463,6 @@ Because in the expression's type: However the following candidate: 'a' Differs from the expected type: 'b' ------------------------------- Detailed message ------------------------------ - - 'a' | 'b' is not compatible with 'b' - because - 'a' is not compatible with 'b' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1269:5 │ @@ -624,16 +475,9 @@ error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types ┌─ eqwater/src/eqwater.erl:1286:60 │ 1286 │ negate_atoms_neg(A) when not ((A == a) orelse (A == b)) -> A; - │ ^ - │ │ - │ A. + │ ^ A. Expression has type: 'c' Context expected type: 'a' | 'b' - │ - - 'c' is not compatible with 'a' | 'b' - because - 'c' is not compatible with 'a' error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater.erl:1291:43 diff --git a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_lists.pretty b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_lists.pretty index c5cd5a3b25..bfb8103b16 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_lists.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_lists.pretty @@ -16,14 +16,6 @@ Because in the expression's type: Differs from the expected type: binary() ] ------------------------------- Detailed message ------------------------------ - - [binary() | atom()] is not compatible with [binary()] - because - binary() | atom() is not compatible with binary() - because - atom() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_lists.erl:48:23 │ @@ -57,12 +49,6 @@ Because in the expression's type: However the following candidate: [] Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - atom() | [] is not compatible with atom() - because - [] is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_lists.erl:61:19 │ @@ -79,12 +65,6 @@ Because in the expression's type: However the following candidate: [] Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - atom() | [] is not compatible with atom() - because - [] is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_lists.erl:69:19 │ @@ -121,14 +101,6 @@ Because in the expression's type: Context expects type: binary() ] ------------------------------- Detailed message ------------------------------ - - [atom()] | [binary()] is not compatible with [binary()] - because - [atom()] is not compatible with [binary()] - because - atom() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_lists.erl:97:23 │ @@ -155,14 +127,4 @@ Because in the expression's type: Differs from the expected type: atom() ] ------------------------------- Detailed message ------------------------------ - - [atom() | binary()] is not compatible with [atom()] | [binary()] - because - [atom() | binary()] is not compatible with [atom()] - because - atom() | binary() is not compatible with atom() - because - binary() is not compatible with atom() - 8 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_maps.pretty b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_maps.pretty index 847411f766..037e6b14a6 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_maps.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_maps.pretty @@ -14,10 +14,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_maps.erl:27:22 │ @@ -34,10 +30,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_maps.erl:36:22 │ @@ -54,12 +46,6 @@ Because in the expression's type: However the following candidate: #{} Differs from the expected type: 'ok' ------------------------------- Detailed message ------------------------------ - - #{} | 'ok' is not compatible with 'ok' - because - #{} is not compatible with 'ok' - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_maps.erl:42:22 │ @@ -76,10 +62,6 @@ Because in the expression's type: Context expects type: #{b := ..., ...} The type of the expression is missing the following required keys: b. ------------------------------- Detailed message ------------------------------ - -key `b` is declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_maps.erl:55:34 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_records.pretty b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_records.pretty index 5a01001d2e..245813d1e8 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_records.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_records.pretty @@ -14,14 +14,6 @@ Because in the expression's type: However the following candidate: #rec1{} Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - user() is not compatible with number() - because - #rec1{} | number() is not compatible with number() - because - #rec1{} is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_records.erl:40:16 │ @@ -38,14 +30,6 @@ Because in the expression's type: However the following candidate: #rec1{} Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - user() is not compatible with number() - because - #rec1{} | number() is not compatible with number() - because - #rec1{} is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_records.erl:47:11 │ @@ -62,14 +46,6 @@ Because in the expression's type: However the following candidate: #rec1{} Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - user() is not compatible with number() - because - #rec1{} | number() is not compatible with number() - because - #rec1{} is not compatible with number() - error: clause_not_covered (See https://fb.me/eqwalizer_errors#clause_not_covered) ┌─ eqwater/src/eqwater_records.erl:104:1 │ @@ -96,15 +72,6 @@ Because in the expression's type: Context expects type: #rec1{} , #rec1{}} ------------------------------- Detailed message ------------------------------ - - {#rec1{}, #rec2{}} | {#rec2{}, #rec1{}} is not compatible with {#rec1{}, #rec2{}} - because - at tuple index 1: - {#rec2{}, #rec1{}} is not compatible with {#rec1{}, #rec2{}} - because - #rec2{} is not compatible with #rec1{} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_records.erl:115:25 │ @@ -124,13 +91,4 @@ Because in the expression's type: Context expects type: #rec1{} , #rec1{}} ------------------------------- Detailed message ------------------------------ - - {#rec1{}, #rec2{}} | {#rec2{}, #rec1{}} is not compatible with {#rec1{}, #rec2{}} - because - at tuple index 1: - {#rec2{}, #rec1{}} is not compatible with {#rec1{}, #rec2{}} - because - #rec2{} is not compatible with #rec1{} - 6 ERRORS diff --git a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_sound.pretty b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_sound.pretty index 4ee35cc78d..332e999cda 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_sound.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/eqwater_sound.pretty @@ -14,14 +14,6 @@ Because in the expression's type: However the following candidate: binary() Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - ab() is not compatible with atom() - because - atom() | binary() is not compatible with atom() - because - binary() is not compatible with atom() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_sound.erl:50:14 │ @@ -38,14 +30,6 @@ Because in the expression's type: However the following candidate: atom() Differs from the expected type: binary() ------------------------------- Detailed message ------------------------------ - - ab() is not compatible with binary() - because - atom() | binary() is not compatible with binary() - because - atom() is not compatible with binary() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/eqwater_sound.erl:53:28 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/unlimited_refinement.pretty b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/unlimited_refinement.pretty index 8b70994f10..c0c48c5e3c 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/eqwater/unlimited_refinement.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/eqwater/unlimited_refinement.pretty @@ -14,12 +14,6 @@ Because in the expression's type: However the following candidate: binary() Differs from the expected type: number() ------------------------------- Detailed message ------------------------------ - - binary() | number() is not compatible with number() - because - binary() is not compatible with number() - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ eqwater/src/unlimited_refinement.erl:94:14 │ diff --git a/crates/elp/src/resources/test/eqwalizer_tests/fault_tolerance/fault_tolerance.pretty b/crates/elp/src/resources/test/eqwalizer_tests/fault_tolerance/fault_tolerance.pretty index 803ac23f35..554970c163 100644 --- a/crates/elp/src/resources/test/eqwalizer_tests/fault_tolerance/fault_tolerance.pretty +++ b/crates/elp/src/resources/test/eqwalizer_tests/fault_tolerance/fault_tolerance.pretty @@ -416,12 +416,6 @@ Because in the expression's type: Context expects type: atom() ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [atom()] - because - term() is not compatible with atom() - error: expected_fun_type (See https://fb.me/eqwalizer_errors#expected_fun_type) ┌─ fault_tolerance/src/fault_tolerance.erl:169:8 │ @@ -672,12 +666,6 @@ Because in the expression's type: However the following candidate: [] Differs from the expected type: atom() ------------------------------- Detailed message ------------------------------ - - dynamic() | [] is not compatible with atom() - because - [] is not compatible with atom() - error: expected_fun_type (See https://fb.me/eqwalizer_errors#expected_fun_type) ┌─ fault_tolerance/src/fault_tolerance.erl:254:11 │ diff --git a/crates/elp/src/resources/test/standard/eqwalize_all_bail_on_error_failure.pretty b/crates/elp/src/resources/test/standard/eqwalize_all_bail_on_error_failure.pretty index 08361b2a89..bfbe45f508 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_all_bail_on_error_failure.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_all_bail_on_error_failure.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,17 +85,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/test/app_a_SUITE.erl:18:5 │ @@ -179,14 +153,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -204,12 +170,6 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ app_a/src/app_a_mod2.erl:22:1 │ diff --git a/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.jsonl b/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.jsonl index 536452ef3a..8636389098 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.jsonl +++ b/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.jsonl @@ -2,9 +2,9 @@ {"path":"app_a/src/app_a.erl","line":14,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'error'","replacement":null,"description":"```lang=error,counterexample\n`'error'`.\n\nExpression has type: 'error'\nContext expected type: 'ok'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a.erl","line":18,"char":13,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'an_atom'","replacement":null,"description":"```lang=error,counterexample\n`'an_atom'`.\n\nExpression has type: 'an_atom'\nContext expected type: number()\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a.erl","line":56,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: redundant_fixme","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nredundant fixme\n```\n\n> [docs on `redundant_fixme`](https://fb.me/eqwalizer_errors#redundant_fixme)","docPath":null} -{"path":"app_a/src/app_a.erl","line":78,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n```\n```\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n\n------------------------------ Detailed message ------------------------------\n\nkeys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a.erl","line":102,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a.erl","line":125,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":78,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n```\n```\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":102,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":125,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/test/app_a_SUITE.erl","line":18,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"app_a_test_helpers:fail()","replacement":null,"description":"```lang=error,counterexample\n`app_a_test_helpers:fail()`.\n\nExpression has type: 'error'\nContext expected type: 'ok'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a_errors_generated.erl","line":8,"char":10,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'wrong_ret'","replacement":null,"description":"```lang=error,counterexample\n`'wrong_ret'`.\n\nExpression has type: 'wrong_ret'\nContext expected type: 'foo'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a_lists.erl","line":576,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"flatmap(thing_to_list/1, List)","replacement":null,"description":"```lang=error,counterexample\n`flatmap(thing_to_list/1, List)`.\n\nExpression has type: [term()]\nContext expected type: string()\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} @@ -12,8 +12,8 @@ {"path":"app_a/src/app_a_lists.erl","line":595,"char":29,"code":"ELP","severity":"error","name":"eqWAlizer: recursive_constraint","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nRecursive constraint: DeepList\n```\n\n> [docs on `recursive_constraint`](https://fb.me/eqwalizer_errors#recursive_constraint)","docPath":null} {"path":"app_a/src/app_a_lists.erl","line":613,"char":29,"code":"ELP","severity":"error","name":"eqWAlizer: recursive_constraint","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nRecursive constraint: DeepList\n```\n\n> [docs on `recursive_constraint`](https://fb.me/eqwalizer_errors#recursive_constraint)","docPath":null} {"path":"app_a/src/app_a_lists.erl","line":1114,"char":36,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"H3","replacement":null,"description":"```lang=error,counterexample\n`H3`.\n\nExpression has type: term()\nContext expected type: [term()]\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a_lists.erl","line":1305,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"filtermap(F, L)","replacement":null,"description":"```lang=error,counterexample\n`filtermap(F, L)`.\n\nExpression has type: [term()]\nContext expected type: [T | X]\n```\n```\nBecause in the expression's type:\n [\n Here the type is: term()\n Context expects type: T | X\n No candidate matches in the expected union.\n ]\n\n------------------------------ Detailed message ------------------------------\n\n [term()] is not compatible with [T | X]\n because\n term() is not compatible with T | X\n because\n term() is not compatible with T\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a_lists.erl","line":1305,"char":15,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"F","replacement":null,"description":"```lang=error,counterexample\n`F`.\n\nExpression has type: fun((T) -> boolean() | {'true', X})\nContext expected type: fun((term()) -> boolean() | {'true', term()})\n```\n```\nBecause in the expression's type:\n fun((\n Here the type is: term()\n Context expects type: T\n ) -> boolean() | {'true', X})\n\n------------------------------ Detailed message ------------------------------\n\n fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()})\n because\n term() is not compatible with T\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a_lists.erl","line":1305,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"filtermap(F, L)","replacement":null,"description":"```lang=error,counterexample\n`filtermap(F, L)`.\n\nExpression has type: [term()]\nContext expected type: [T | X]\n```\n```\nBecause in the expression's type:\n [\n Here the type is: term()\n Context expects type: T | X\n No candidate matches in the expected union.\n ]\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a_lists.erl","line":1305,"char":15,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"F","replacement":null,"description":"```lang=error,counterexample\n`F`.\n\nExpression has type: fun((T) -> boolean() | {'true', X})\nContext expected type: fun((term()) -> boolean() | {'true', term()})\n```\n```\nBecause in the expression's type:\n fun((\n Here the type is: term()\n Context expects type: T\n ) -> boolean() | {'true', X})\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a_mod2.erl","line":22,"char":1,"code":"ELP","severity":"error","name":"eqWAlizer: type_alias_is_non_productive","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nrecursive type invalid/0 is not productive\n```\n\n> [docs on `type_alias_is_non_productive`](https://fb.me/eqwalizer_errors#type_alias_is_non_productive)","docPath":null} {"path":"app_a/src/app_a_mod2.erl","line":31,"char":9,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'an_atom'","replacement":null,"description":"```lang=error,counterexample\n`'an_atom'`.\n\nExpression has type: 'an_atom'\nContext expected type: number()\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/test/app_a_test_helpers.erl","line":6,"char":11,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'wrong_ret'","replacement":null,"description":"```lang=error,counterexample\n`'wrong_ret'`.\n\nExpression has type: 'wrong_ret'\nContext expected type: 'error'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} diff --git a/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.pretty b/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.pretty index 08361b2a89..bfbe45f508 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,17 +85,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/test/app_a_SUITE.erl:18:5 │ @@ -179,14 +153,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -204,12 +170,6 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ app_a/src/app_a_mod2.erl:22:1 │ diff --git a/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics_gen.jsonl b/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics_gen.jsonl index 536452ef3a..8636389098 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics_gen.jsonl +++ b/crates/elp/src/resources/test/standard/eqwalize_all_diagnostics_gen.jsonl @@ -2,9 +2,9 @@ {"path":"app_a/src/app_a.erl","line":14,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'error'","replacement":null,"description":"```lang=error,counterexample\n`'error'`.\n\nExpression has type: 'error'\nContext expected type: 'ok'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a.erl","line":18,"char":13,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'an_atom'","replacement":null,"description":"```lang=error,counterexample\n`'an_atom'`.\n\nExpression has type: 'an_atom'\nContext expected type: number()\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a.erl","line":56,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: redundant_fixme","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nredundant fixme\n```\n\n> [docs on `redundant_fixme`](https://fb.me/eqwalizer_errors#redundant_fixme)","docPath":null} -{"path":"app_a/src/app_a.erl","line":78,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n```\n```\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n\n------------------------------ Detailed message ------------------------------\n\nkeys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a.erl","line":102,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a.erl","line":125,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":78,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n```\n```\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":102,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":125,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/test/app_a_SUITE.erl","line":18,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"app_a_test_helpers:fail()","replacement":null,"description":"```lang=error,counterexample\n`app_a_test_helpers:fail()`.\n\nExpression has type: 'error'\nContext expected type: 'ok'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a_errors_generated.erl","line":8,"char":10,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'wrong_ret'","replacement":null,"description":"```lang=error,counterexample\n`'wrong_ret'`.\n\nExpression has type: 'wrong_ret'\nContext expected type: 'foo'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a_lists.erl","line":576,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"flatmap(thing_to_list/1, List)","replacement":null,"description":"```lang=error,counterexample\n`flatmap(thing_to_list/1, List)`.\n\nExpression has type: [term()]\nContext expected type: string()\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} @@ -12,8 +12,8 @@ {"path":"app_a/src/app_a_lists.erl","line":595,"char":29,"code":"ELP","severity":"error","name":"eqWAlizer: recursive_constraint","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nRecursive constraint: DeepList\n```\n\n> [docs on `recursive_constraint`](https://fb.me/eqwalizer_errors#recursive_constraint)","docPath":null} {"path":"app_a/src/app_a_lists.erl","line":613,"char":29,"code":"ELP","severity":"error","name":"eqWAlizer: recursive_constraint","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nRecursive constraint: DeepList\n```\n\n> [docs on `recursive_constraint`](https://fb.me/eqwalizer_errors#recursive_constraint)","docPath":null} {"path":"app_a/src/app_a_lists.erl","line":1114,"char":36,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"H3","replacement":null,"description":"```lang=error,counterexample\n`H3`.\n\nExpression has type: term()\nContext expected type: [term()]\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a_lists.erl","line":1305,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"filtermap(F, L)","replacement":null,"description":"```lang=error,counterexample\n`filtermap(F, L)`.\n\nExpression has type: [term()]\nContext expected type: [T | X]\n```\n```\nBecause in the expression's type:\n [\n Here the type is: term()\n Context expects type: T | X\n No candidate matches in the expected union.\n ]\n\n------------------------------ Detailed message ------------------------------\n\n [term()] is not compatible with [T | X]\n because\n term() is not compatible with T | X\n because\n term() is not compatible with T\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a_lists.erl","line":1305,"char":15,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"F","replacement":null,"description":"```lang=error,counterexample\n`F`.\n\nExpression has type: fun((T) -> boolean() | {'true', X})\nContext expected type: fun((term()) -> boolean() | {'true', term()})\n```\n```\nBecause in the expression's type:\n fun((\n Here the type is: term()\n Context expects type: T\n ) -> boolean() | {'true', X})\n\n------------------------------ Detailed message ------------------------------\n\n fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()})\n because\n term() is not compatible with T\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a_lists.erl","line":1305,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"filtermap(F, L)","replacement":null,"description":"```lang=error,counterexample\n`filtermap(F, L)`.\n\nExpression has type: [term()]\nContext expected type: [T | X]\n```\n```\nBecause in the expression's type:\n [\n Here the type is: term()\n Context expects type: T | X\n No candidate matches in the expected union.\n ]\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a_lists.erl","line":1305,"char":15,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"F","replacement":null,"description":"```lang=error,counterexample\n`F`.\n\nExpression has type: fun((T) -> boolean() | {'true', X})\nContext expected type: fun((term()) -> boolean() | {'true', term()})\n```\n```\nBecause in the expression's type:\n fun((\n Here the type is: term()\n Context expects type: T\n ) -> boolean() | {'true', X})\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a_mod2.erl","line":22,"char":1,"code":"ELP","severity":"error","name":"eqWAlizer: type_alias_is_non_productive","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nrecursive type invalid/0 is not productive\n```\n\n> [docs on `type_alias_is_non_productive`](https://fb.me/eqwalizer_errors#type_alias_is_non_productive)","docPath":null} {"path":"app_a/src/app_a_mod2.erl","line":31,"char":9,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'an_atom'","replacement":null,"description":"```lang=error,counterexample\n`'an_atom'`.\n\nExpression has type: 'an_atom'\nContext expected type: number()\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/test/app_a_test_helpers.erl","line":6,"char":11,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'wrong_ret'","replacement":null,"description":"```lang=error,counterexample\n`'wrong_ret'`.\n\nExpression has type: 'wrong_ret'\nContext expected type: 'error'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} diff --git a/crates/elp/src/resources/test/standard/eqwalize_app_a.jsonl b/crates/elp/src/resources/test/standard/eqwalize_app_a.jsonl index f56ea404dc..943c4a231d 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_app_a.jsonl +++ b/crates/elp/src/resources/test/standard/eqwalize_app_a.jsonl @@ -2,6 +2,6 @@ {"path":"app_a/src/app_a.erl","line":14,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'error'","replacement":null,"description":"```lang=error,counterexample\n`'error'`.\n\nExpression has type: 'error'\nContext expected type: 'ok'\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a.erl","line":18,"char":13,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"'an_atom'","replacement":null,"description":"```lang=error,counterexample\n`'an_atom'`.\n\nExpression has type: 'an_atom'\nContext expected type: number()\n```\n\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} {"path":"app_a/src/app_a.erl","line":56,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: redundant_fixme","original":null,"replacement":null,"description":"```lang=error,counterexample\n\nredundant fixme\n```\n\n> [docs on `redundant_fixme`](https://fb.me/eqwalizer_errors#redundant_fixme)","docPath":null} -{"path":"app_a/src/app_a.erl","line":78,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n```\n```\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n\n------------------------------ Detailed message ------------------------------\n\nkeys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a.erl","line":102,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} -{"path":"app_a/src/app_a.erl","line":125,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":78,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n```\n```\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":102,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} +{"path":"app_a/src/app_a.erl","line":125,"char":5,"code":"ELP","severity":"error","name":"eqWAlizer: incompatible_types","original":"X","replacement":null,"description":"```lang=error,counterexample\n`X`.\n\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n```\n```\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n```\n> [docs on `incompatible_types`](https://fb.me/eqwalizer_errors#incompatible_types)","docPath":null} diff --git a/crates/elp/src/resources/test/standard/eqwalize_app_a.pretty b/crates/elp/src/resources/test/standard/eqwalize_app_a.pretty index 3cfdbd0dc2..f5f3065414 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_app_a.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_app_a.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,15 +85,4 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - 7 ERRORS diff --git a/crates/elp/src/resources/test/standard/eqwalize_app_a_lists_fast.pretty b/crates/elp/src/resources/test/standard/eqwalize_app_a_lists_fast.pretty index f61a47edfe..8c93bd01fe 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_app_a_lists_fast.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_app_a_lists_fast.pretty @@ -50,14 +50,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -75,10 +67,4 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - 7 ERRORS diff --git a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics.pretty b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics.pretty index 472665ffe8..482195c7ab 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,17 +85,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_errors_generated.erl:8:10 │ @@ -171,14 +145,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -196,12 +162,6 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ app_a/src/app_a_mod2.erl:22:1 │ diff --git a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen.pretty b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen.pretty index 472665ffe8..482195c7ab 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,17 +85,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_errors_generated.erl:8:10 │ @@ -171,14 +145,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -196,12 +162,6 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ app_a/src/app_a_mod2.erl:22:1 │ diff --git a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen_rebar.pretty b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen_rebar.pretty index 6782313a4a..67d78913b6 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen_rebar.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_gen_rebar.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,17 +85,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/test/app_a_SUITE.erl:18:5 │ @@ -179,14 +153,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -204,12 +170,6 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ app_a/src/app_a_mod2.erl:22:1 │ diff --git a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_rebar.pretty b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_rebar.pretty index 6782313a4a..67d78913b6 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_rebar.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_app_diagnostics_rebar.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,17 +85,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/test/app_a_SUITE.erl:18:5 │ @@ -179,14 +153,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -204,12 +170,6 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ app_a/src/app_a_mod2.erl:22:1 │ diff --git a/crates/elp/src/resources/test/standard/eqwalize_target_diagnostics.pretty b/crates/elp/src/resources/test/standard/eqwalize_target_diagnostics.pretty index 472665ffe8..482195c7ab 100644 --- a/crates/elp/src/resources/test/standard/eqwalize_target_diagnostics.pretty +++ b/crates/elp/src/resources/test/standard/eqwalize_target_diagnostics.pretty @@ -44,10 +44,6 @@ Because in the expression's type: Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...} The type of the expression is missing the following required keys: k_req3, k_req2, k_req1. ------------------------------- Detailed message ------------------------------ - -keys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:102:5 │ @@ -68,17 +64,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a.erl:125:5 │ @@ -100,17 +85,6 @@ Because in the expression's type: , ... } , ... } ------------------------------- Detailed message ------------------------------ - - id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - at key `b`: - #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}} - because - #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})} - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_errors_generated.erl:8:10 │ @@ -171,14 +145,6 @@ Because in the expression's type: No candidate matches in the expected union. ] ------------------------------- Detailed message ------------------------------ - - [term()] is not compatible with [T | X] - because - term() is not compatible with T | X - because - term() is not compatible with T - error: incompatible_types (See https://fb.me/eqwalizer_errors#incompatible_types) ┌─ app_a/src/app_a_lists.erl:1305:15 │ @@ -196,12 +162,6 @@ Because in the expression's type: Context expects type: T ) -> boolean() | {'true', X}) ------------------------------- Detailed message ------------------------------ - - fun((T) -> boolean() | {'true', X}) is not compatible with fun((term()) -> boolean() | {'true', term()}) - because - term() is not compatible with T - error: type_alias_is_non_productive (See https://fb.me/eqwalizer_errors#type_alias_is_non_productive) ┌─ app_a/src/app_a_mod2.erl:22:1 │ diff --git a/crates/elp/tests/slow-tests/main.rs b/crates/elp/tests/slow-tests/main.rs index 98455e8850..60167593fd 100644 --- a/crates/elp/tests/slow-tests/main.rs +++ b/crates/elp/tests/slow-tests/main.rs @@ -268,7 +268,7 @@ fn test_e2e_eqwalizer_module() { "codeDescription": { "href": "https://fb.me/eqwalizer_errors#incompatible_types" }, - "message": "`X`.\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n\n------------------------------ Detailed message ------------------------------\n\nkeys `k_req1`, `k_req2`, `k_req3` are declared as required in the latter but not in the former\n See https://fb.me/eqwalizer_errors#incompatible_types", + "message": "`X`.\nExpression has type: #{k_extra => term(), k_ok => term(), k_req1 => term(), k_req2 => term(), k_wrong1 => pid(), k_wrong2 => pid()}\nContext expected type: #{k_ok => term(), k_req1 := atom(), k_req2 := atom(), k_req3 := atom(), k_wrong1 => atom(), k_wrong2 => atom()}\n\nBecause in the expression's type:\n Here the type is: #{k_req2 => ..., k_req1 => ..., ...}\n Context expects type: #{k_req3 := ..., k_req2 := ..., k_req1 := ..., ...}\n The type of the expression is missing the following required keys: k_req3, k_req2, k_req1.\n See https://fb.me/eqwalizer_errors#incompatible_types", "range": { "end": { "character": 5, @@ -287,7 +287,7 @@ fn test_e2e_eqwalizer_module() { "codeDescription": { "href": "https://fb.me/eqwalizer_errors#incompatible_types" }, - "message": "`X`.\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d => atom()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d => atom()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d => atom()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n See https://fb.me/eqwalizer_errors#incompatible_types", + "message": "`X`.\nExpression has type: id(#{a := 'va', b := #{c := #{d => atom()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n Here the type is: #{d => ..., ...}\n Context expects type: #{d := ..., e := ..., ...}\n The type of the expression is missing the following required keys: d, e.\n , ... }\n , ... }\n See https://fb.me/eqwalizer_errors#incompatible_types", "range": { "end": { "character": 5, @@ -306,7 +306,7 @@ fn test_e2e_eqwalizer_module() { "codeDescription": { "href": "https://fb.me/eqwalizer_errors#incompatible_types" }, - "message": "`X`.\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n\n------------------------------ Detailed message ------------------------------\n\n id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}}) is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n at key `b`:\n #{a := 'va', b := #{c := #{d := pid(), e := pid()}}} is not compatible with #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n because\n #{c := #{d := pid(), e := pid()}} is not compatible with #{c := id(#{d := atom(), e := atom()})}\n See https://fb.me/eqwalizer_errors#incompatible_types", + "message": "`X`.\nExpression has type: id(#{a := 'va', b := #{c := #{d := pid(), e := pid()}}})\nContext expected type: #{a := 'va', b := #{c := id(#{d := atom(), e := atom()})}}\n\nBecause in the expression's type:\n #{ b =>\n #{ c =>\n #{ d =>\n Here the type is: pid()\n Context expects type: atom()\n , ... }\n , ... }\n , ... }\n See https://fb.me/eqwalizer_errors#incompatible_types", "range": { "end": { "character": 5,