-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Snapshot tests for reporting of bad maps. Reviewed By: ilya-klyuchnikov Differential Revision: D62180615 fbshipit-source-id: a785acf4f6a87aa12493eda088ad7f7cf17fe063
- Loading branch information
1 parent
87beaca
commit 5e1dd10
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
crates/elp/src/resources/test/eqwalizer_tests/options/bad_maps.pretty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
error: bad_map_key | ||
┌─ options/src/bad_maps.erl:10:24 | ||
│ | ||
10 │ -type bad_map_1() :: #{atom() := integer()}. | ||
│ ^^^^^^^^^^^^^^^^^ Required map key should always be a singular atom. Map type will be approximated to #{dynamic() => dynamic()}. | ||
|
||
See https://fb.me/eqwalizer_errors#bad_map_key | ||
|
||
error: bad_map_key | ||
┌─ options/src/bad_maps.erl:12:32 | ||
│ | ||
12 │ -type bad_map_2() :: #{a => b, atom() => integer()}. | ||
│ ^^^^^^^^^^^^^^^^^ With multiple assocations, all keys should be singular atoms. Map type will be approximated to #{dynamic() => dynamic()}. | ||
|
||
See https://fb.me/eqwalizer_errors#bad_map_key | ||
|
||
error: bad_map_key | ||
┌─ options/src/bad_maps.erl:14:32 | ||
│ | ||
14 │ -type bad_map_3() :: #{a => b, atom() := integer()}. | ||
│ ^^^^^^^^^^^^^^^^^ Required map key should always be a singular atom. Map type will be approximated to #{dynamic() => dynamic()}. | ||
|
||
See https://fb.me/eqwalizer_errors#bad_map_key | ||
|
||
error: bad_map_key | ||
┌─ options/src/bad_maps.erl:16:30 | ||
│ | ||
16 │ -spec bad_map_spec(#{a => b, atom() => integer()}) -> ok. | ||
│ ^^^^^^^^^^^^^^^^^ With multiple assocations, all keys should be singular atoms. Map type will be approximated to #{dynamic() => dynamic()}. | ||
|
||
See https://fb.me/eqwalizer_errors#bad_map_key | ||
|
||
4 ERRORS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
%%% Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. | ||
%%% | ||
%%% This source code is licensed under the Apache 2.0 license found in | ||
%%% the LICENSE file in the root directory of this source tree. | ||
|
||
-module(bad_maps). | ||
|
||
-compile([export_all, nowarn_export_all]). | ||
|
||
-type bad_map_1() :: #{atom() := integer()}. | ||
|
||
-type bad_map_2() :: #{a => b, atom() => integer()}. | ||
|
||
-type bad_map_3() :: #{a => b, atom() := integer()}. | ||
|
||
-spec bad_map_spec(#{a => b, atom() => integer()}) -> ok. | ||
bad_map_spec(M) -> ok. |