diff options
Diffstat (limited to 'dev-lang/elixir')
-rw-r--r-- | dev-lang/elixir/Manifest | 12 | ||||
-rw-r--r-- | dev-lang/elixir/elixir-1.11.4-r1.ebuild | 41 | ||||
-rw-r--r-- | dev-lang/elixir/elixir-1.11.4.ebuild | 1 | ||||
-rw-r--r-- | dev-lang/elixir/elixir-1.12.1.ebuild | 1 | ||||
-rw-r--r-- | dev-lang/elixir/elixir-1.12.2.ebuild | 1 | ||||
-rw-r--r-- | dev-lang/elixir/elixir-1.12.3.ebuild | 38 | ||||
-rw-r--r-- | dev-lang/elixir/files/elixir-1.11.4-fix-elixir-test.patch | 33 | ||||
-rw-r--r-- | dev-lang/elixir/files/elixir-1.11.4-fix-logger-translator-with-otp-24-11222.patch | 64 | ||||
-rw-r--r-- | dev-lang/elixir/files/elixir-1.11.4-update-warnings-for-OTP-master-10807.patch | 125 |
9 files changed, 313 insertions, 3 deletions
diff --git a/dev-lang/elixir/Manifest b/dev-lang/elixir/Manifest index 5e0ac334807c..82b762397292 100644 --- a/dev-lang/elixir/Manifest +++ b/dev-lang/elixir/Manifest @@ -1,11 +1,17 @@ AUX elixir-1.10.3-epmd-daemon.patch 512 BLAKE2B c767cf4336214396d953efe568f0302d6852ec5332575202c167f38553deb9878b69d0744ed8a4062bbcb996df840f759f390ddc0c5e467aeab99250dee5a72e SHA512 dfe12ca0b47529a29d87871c9b31728099f816a0bd416512dd2409686fe6ceeb0e80e9da322ff38df27600da3235d174b365c80b8cae0e55eaee328b1260bc0d AUX elixir-1.10.3-no-Q.patch 355 BLAKE2B 903e5a7149f6e7f7030a533ae437b0e40b97c82c6baa7f90c1dff37fedf96c2e821e98529007e2300a92b8b3e9284428d91d6ee45888da7d79b18d35dfd89e58 SHA512 21d28b63fee2877337c0df095cfa200ae11ec2f0c76556e971957bb92e2b8e9d811c939b1efa458c633b61d3525f47a8b04d1b6f23df04e50ffb3ed5225f7c18 AUX elixir-1.11.2-mksh.patch 2058 BLAKE2B 45e14921fc59f5707ee9bc2aaebea5f090a5995d07e1aa773d3751690230ded1abade17179f643e787ae3b53661c8ad7bafdf295fd1eb21d534c0b38a0083a1b SHA512 a888b73638873a5b7a6c5f2576c81d58e8df854e2ab3ecfbcf547da5aeea4eee0f43798a1c1308bc7f3515af2d28e78740c4016fde0f5e0eea2114dac7d98de6 +AUX elixir-1.11.4-fix-elixir-test.patch 1170 BLAKE2B 05707d9d095f95d6d0fe3b21bd4078a933e3e2067596da5b1bc0a272d007abfe43317829d745c363a511a6b9e64a66727e92f64405a7ccbfb42aa0eae1a1a807 SHA512 2cef12a7339aab75368c24bb53764352bf6ad2275a51baef18e44e607f947cbd2829602587d849f9d6d7ad1c646f73db39d81bf331a38c95c259af8b483aece1 +AUX elixir-1.11.4-fix-logger-translator-with-otp-24-11222.patch 2355 BLAKE2B 4189a7f8189d595db3a194edbf54d448fbf13665d29a3ad6eb7a8c5909c17cd53958f5b675666f9219aff016dc0c6aa04f815e80ad7de919c05d5d515a82e717 SHA512 713af811385379982b35054301f4032fada4e27e63de7a8344323d36eee7b52bc519a73c61554c33ebba97b88b6abbc14daa65111ff53caec73b0c06c542230b +AUX elixir-1.11.4-update-warnings-for-OTP-master-10807.patch 5564 BLAKE2B a3e3a43c041df9842071beea4700f68fe4b2da0af4318711511e568599a31cd086544c8b2cb3b4a72232c1e26a8b2f29e97f80fa02e5c2a9de04c952c3c5fb92 SHA512 5c3f10588ad8c8f3bad92c500eb0db452ac2c72ac640674a0e6fecae6064ffd5a3d1cddea6e5bcb56d723043ce8586df4cb1538873f56854a5d05c70eebac12b AUX elixir-1.9.1-disable-network-tests.patch 569 BLAKE2B fda6b9b99f80e81883723280de31933c1740167d41ef4783dc663bad277cf58b8782326abc4a72e0d989c513afb9cdf4494e7d79754b18d62baf75255a74aa45 SHA512 465831a389891680412d51d9209497d5b750ff0a5ff72d45807a7dba6ec7757156ee96048bbc81f46c9c24a5b13cdd5161539fdeb4ffcea655c407e29f6675fc DIST elixir-1.11.4.tar.gz 2396885 BLAKE2B f63e835991420bce8cacd38a920637aa5656c0372bd09e8c0a357a24bcca9a06350973f1453f482d3854a48712471c55389c3bd530df46a19c20a359376b779d SHA512 5dc940a31a31ae1c1537f874c15e58311cc0b0452f61e923bdfde0a5cfef3d8003eb3e85be320eb0acfb7bc0c0c0dc8ac965dec6727257c244048268fbf38ceb DIST elixir-1.12.1.tar.gz 2458060 BLAKE2B 512f016cb7f064f2b90a4d2dae4ffaf957422f049322b5fbed1eef155687b1111de89df838c254cf123b904e64f746fc19175372166526c739d8a1d66f9abb0c SHA512 ecea8a95d05e85431c324c7e15fdd08639a52fa6031fb8ec671825debecd892d2258b3914fdd8417728be1a18202d211eeb19869797ad0fd022c6ec91cd05880 DIST elixir-1.12.2.tar.gz 2460047 BLAKE2B eebcb4b828bf445ece6bfceb40b228406a15b0d33fb6efcc2b34fa4a264d83c5d71aa9787c5b641e903fb97ba02da07f3edf76424136e3dab0248a65823f225f SHA512 4c19a6a0310606b3016b3699079dc5f667e348c86c92e7e998cbecbacd283f5f4ccdd3d83b757725ba637a39729e9d82673b596feee72e831d575630e2f3111a -EBUILD elixir-1.11.4.ebuild 922 BLAKE2B 718117a8aee4294e70930d45d6b39d6522026c48165b9af54eae4b612458509e456586e8c6a256175ed4e66a6e36293d22d65d69b1fb40ec28efb6ee1b511fbf SHA512 e77cad093155fbcbab5247c18c4c45db407df167c296d9587c19826d303c0e38f431bb4c3ea61537dbfd0c211d4917ce08a38c6f6a2c7fb1c6040c0e279c9b8a -EBUILD elixir-1.12.1.ebuild 883 BLAKE2B aced08cbe2bf019d89d11d0fb85a884e96ff211d348f8af7cf9699bc1793a85850e736d7c2fa35cf9e026875b5771bb06d99a6a03ef2cbfb7aa9033eeff0d0c9 SHA512 544bea168a5dbd07b7820e1e18c71221379785434a59350d5e2434dcb0f9c3f0447a0644dfc3a656555c261c2f290684c7131e0ada4e73884b016e7b69bc29e9 -EBUILD elixir-1.12.2.ebuild 886 BLAKE2B 946c6fb8fc5b2500ff4a58bda868b3ed5beacd1065e49ca410a0fb38c3411482843dce90a4eab87ae8ac96567cd167ffcafcbf960dd059d8411744e3fd125597 SHA512 8256f2f7d0d3e064b99059f5d9b2defb4275bbaf81529e44bd761b28e035e11dfcba21c8f446b9368198d9047980fc955c3c6faa9bd03a9c818ccd2e26dd0c49 +DIST elixir-1.12.3.tar.gz 2461828 BLAKE2B cdae9bd7f3463b89dd737ce943d57b7f9801bf382500a274332e1cb87902ecc37bd6e7a53af4dd5c1cd6e6d9d64171e226e676cd8023252c86fdf028d80dd383 SHA512 945e33ca9c3e50015531f87630c1bc1b9966acc64bbf7d01c8c4f8cfc104ee1e08113f572f0ad6a9f5e8ee37e33144e58b2ac33dc0a2b01e1355fc5f8b1b9329 +EBUILD elixir-1.11.4-r1.ebuild 1096 BLAKE2B a94f4bfc202bd0765296efdc82ef0665085c502d6dbf3d05ee1f12ee3fa5d3b3ae38d70bb6b2db272e3977838147296934c9616caa8e535b5f4f994842aac92d SHA512 9e201821797a284cd214cfb963b15af00c2de951fba16471e05dc7fa13b42e8b1de9329693d3393bbca10005c091cdab20e753d25c063903e89ea04063deae00 +EBUILD elixir-1.11.4.ebuild 943 BLAKE2B a523b08050cbefaeee8093b145dcbe17fdc74b19ec96d22a546d20788fe1d0048719f3fa307c995164a2c5a2bbae96d69e59a59f58d548a6b979787b454e8c08 SHA512 cd83ec4bcfe2f791c4ee4a4eba97d53aa78396849fc5fada8f2bd7a01b69eb9fd315a65a85b0eac67f1f4ee367e43406292673022ca47ab293572af6b87307e4 +EBUILD elixir-1.12.1.ebuild 933 BLAKE2B 5393a8e9405e6d12ef8b1980143430a433345a8ad972e9818c3b480127661f53fdffc168d6ca218cb0fced3f96da4130cd33993a938ecb846150ea1714737fa1 SHA512 e0021e091c4debd7630558990ded0ebe10e61860776f6198ed65c73c354923f7928dffecec407f501fae19eace8c832c9cce4f629f978cc979817d92044236a7 +EBUILD elixir-1.12.2.ebuild 936 BLAKE2B 8e9bfca5e5faf640f947f7715a587457edb147b4c7a6fef399a8bd34cbf9a614e675f4c0f3537928490e76e00085684744c2bba8cb07192ba268904a661fdb73 SHA512 020f6fc50ae4e764fd759df8be748bd813e8183171e705449c55663b0df4777f5d078b4ef667973b659c9481f4723ff114d0f52eecb744e297f799ad22304ce8 +EBUILD elixir-1.12.3.ebuild 936 BLAKE2B 13da7b0562422a7230915d099d9a1e8c50ace16cbd8528100df0d6f6f27babcef50f3ebbde5f75a5a964e304ab6630d297a2ac7980fd0cb638acd0c6163db5b1 SHA512 20db11eb6bd839067056dd16c4d84c0c72cbc138838070b93fcfed0c00e74bb2c07cb37a993e20254c9dfeb8c08998495d69b2dd3dd3c20137b37bdf7a74e0f8 MISC metadata.xml 709 BLAKE2B 484bee8415dd9670201a0532b89d6e316bc6640f7ccb549f0ed5b17ce4474ea1d00e077c078037f39e12e93c21df80554827d0ff3949e7bafe1914ce98da7bfb SHA512 b879ddf3a32ad7a467deed25426274828f970f2ccce6e7a3f7848a8917eb9ad17e161351ecccf45a6a445f1a88178bec27f23075c0e4e19e6f135193eb160b9f diff --git a/dev-lang/elixir/elixir-1.11.4-r1.ebuild b/dev-lang/elixir/elixir-1.11.4-r1.ebuild new file mode 100644 index 000000000000..a4fe19d9ec0d --- /dev/null +++ b/dev-lang/elixir/elixir-1.11.4-r1.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Elixir programming language" +HOMEPAGE="https://elixir-lang.org" +SRC_URI="https://github.com/elixir-lang/elixir/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0 ErlPL-1.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~sparc ~x86" +IUSE="test" + +RESTRICT="!test? ( test )" + +DEPEND=" + >=dev-lang/erlang-21:0=[ssl] +" +# 'mix' tool collides with sci-biology/phylip, bug #537514 +RDEPEND="${DEPEND} + !!sci-biology/phylip +" +DEPEND+=" + test? ( dev-vcs/git ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.9.1-disable-network-tests.patch + "${FILESDIR}"/${PN}-1.10.3-no-Q.patch + "${FILESDIR}"/${PN}-1.10.3-epmd-daemon.patch + "${FILESDIR}"/${PN}-1.11.2-mksh.patch + "${FILESDIR}"/${P}-fix-elixir-test.patch + "${FILESDIR}"/${P}-update-warnings-for-OTP-master-10807.patch + "${FILESDIR}"/${P}-fix-logger-translator-with-otp-24-11222.patch +) + +src_install() { + emake DESTDIR="${D}" LIBDIR="$(get_libdir)" PREFIX="${EPREFIX}/usr" install + dodoc README.md CHANGELOG.md CODE_OF_CONDUCT.md +} diff --git a/dev-lang/elixir/elixir-1.11.4.ebuild b/dev-lang/elixir/elixir-1.11.4.ebuild index cdae3d8bbe4b..f5439a725a0a 100644 --- a/dev-lang/elixir/elixir-1.11.4.ebuild +++ b/dev-lang/elixir/elixir-1.11.4.ebuild @@ -16,6 +16,7 @@ RESTRICT="!test? ( test )" DEPEND=" >=dev-lang/erlang-21:0=[ssl] + <dev-lang/erlang-24 " # 'mix' tool collides with sci-biology/phylip, bug #537514 RDEPEND="${DEPEND} diff --git a/dev-lang/elixir/elixir-1.12.1.ebuild b/dev-lang/elixir/elixir-1.12.1.ebuild index 984a5d1789a1..0b3d30839c63 100644 --- a/dev-lang/elixir/elixir-1.12.1.ebuild +++ b/dev-lang/elixir/elixir-1.12.1.ebuild @@ -29,6 +29,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.9.1-disable-network-tests.patch "${FILESDIR}"/${PN}-1.10.3-no-Q.patch "${FILESDIR}"/${PN}-1.10.3-epmd-daemon.patch + "${FILESDIR}"/${PN}-1.11.4-fix-elixir-test.patch ) src_install() { diff --git a/dev-lang/elixir/elixir-1.12.2.ebuild b/dev-lang/elixir/elixir-1.12.2.ebuild index e35418c14594..9ad390ffec4f 100644 --- a/dev-lang/elixir/elixir-1.12.2.ebuild +++ b/dev-lang/elixir/elixir-1.12.2.ebuild @@ -29,6 +29,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.9.1-disable-network-tests.patch "${FILESDIR}"/${PN}-1.10.3-no-Q.patch "${FILESDIR}"/${PN}-1.10.3-epmd-daemon.patch + "${FILESDIR}"/${PN}-1.11.4-fix-elixir-test.patch ) src_install() { diff --git a/dev-lang/elixir/elixir-1.12.3.ebuild b/dev-lang/elixir/elixir-1.12.3.ebuild new file mode 100644 index 000000000000..116a530e4d38 --- /dev/null +++ b/dev-lang/elixir/elixir-1.12.3.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="Elixir programming language" +HOMEPAGE="https://elixir-lang.org" +SRC_URI="https://github.com/elixir-lang/elixir/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0 ErlPL-1.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~sparc ~x86" +IUSE="test" + +RESTRICT="!test? ( test )" + +DEPEND=" + >=dev-lang/erlang-22:0=[ssl] +" +# 'mix' tool collides with sci-biology/phylip, bug #537514 +RDEPEND="${DEPEND} + !!sci-biology/phylip +" +DEPEND+=" + test? ( dev-vcs/git ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.9.1-disable-network-tests.patch + "${FILESDIR}"/${PN}-1.10.3-no-Q.patch + "${FILESDIR}"/${PN}-1.10.3-epmd-daemon.patch + "${FILESDIR}"/${PN}-1.11.4-fix-elixir-test.patch +) + +src_install() { + emake DESTDIR="${D}" LIBDIR="$(get_libdir)" PREFIX="${EPREFIX}/usr" install + dodoc README.md CHANGELOG.md CODE_OF_CONDUCT.md +} diff --git a/dev-lang/elixir/files/elixir-1.11.4-fix-elixir-test.patch b/dev-lang/elixir/files/elixir-1.11.4-fix-elixir-test.patch new file mode 100644 index 000000000000..6b4dd0c3939b --- /dev/null +++ b/dev-lang/elixir/files/elixir-1.11.4-fix-elixir-test.patch @@ -0,0 +1,33 @@ +From 3e88b1f336f843378790802bd486f6793b7ef872 Mon Sep 17 00:00:00 2001 +From: Jan Smutny <js@excello.cz> +Date: Thu, 14 Oct 2021 16:14:55 +0200 +Subject: [PATCH] Fix elixir test assertion for erlang >=OTP-24.1 + +--- + lib/elixir/test/elixir/exception_test.exs | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/lib/elixir/test/elixir/exception_test.exs b/lib/elixir/test/elixir/exception_test.exs +index df9d46bbc..ae08d5185 100644 +--- a/lib/elixir/test/elixir/exception_test.exs ++++ b/lib/elixir/test/elixir/exception_test.exs +@@ -446,11 +446,12 @@ test "annotates undefined function error with suggestions" do + * min/1 + """ + +- assert blame_message(:erlang, & &1.gt_cookie()) == """ +- function :erlang.gt_cookie/0 is undefined or private. Did you mean one of: ++ assert blame_message(:erlang, & &1.hal()) == """ ++ function :erlang.hal/0 is undefined or private. Did you mean one of: + +- * get_cookie/0 +- * set_cookie/2 ++ * halt/0 ++ * halt/1 ++ * halt/2 + """ + end + +-- +2.31.1 + diff --git a/dev-lang/elixir/files/elixir-1.11.4-fix-logger-translator-with-otp-24-11222.patch b/dev-lang/elixir/files/elixir-1.11.4-fix-logger-translator-with-otp-24-11222.patch new file mode 100644 index 000000000000..428e7ceb3ab4 --- /dev/null +++ b/dev-lang/elixir/files/elixir-1.11.4-fix-logger-translator-with-otp-24-11222.patch @@ -0,0 +1,64 @@ +From b1492cb0cfa689c4c098761a375d5cb728d3c175 Mon Sep 17 00:00:00 2001 +From: Matteo <mbrancaleoni@gmail.com> +Date: Tue, 31 Aug 2021 23:46:27 +0200 +Subject: [PATCH 3/3] Fix logger translator with otp-24 (#11222) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* Handle new significant key in sasl reports + +* Add OTP-24.0 to CI matrix + +Co-authored-by: José Valim <jose.valim@dashbit.co> +--- + .github/workflows/ci.yml | 2 +- + lib/logger/lib/logger/translator.ex | 13 ++++++++++--- + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml +index f43a9ff62..a4bc8dbeb 100644 +--- a/.github/workflows/ci.yml ++++ b/.github/workflows/ci.yml +@@ -15,7 +15,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- otp_release: ['OTP-23.0', 'OTP-22.3', 'OTP-22.0', 'OTP-21.3.8', 'OTP-21.0'] ++ otp_release: ['OTP-24.0', 'OTP-23.0', 'OTP-22.3', 'OTP-22.0', 'OTP-21.3.8', 'OTP-21.0'] + development: [false] + include: + - otp_release: master +diff --git a/lib/logger/lib/logger/translator.ex b/lib/logger/lib/logger/translator.ex +index d1d7e62f1..8afd79436 100644 +--- a/lib/logger/lib/logger/translator.ex ++++ b/lib/logger/lib/logger/translator.ex +@@ -357,15 +357,22 @@ defp child_info(_min_level, _child) do + [] + end + +- defp child_debug(:debug, restart_type: restart, shutdown: shutdown, child_type: type) do +- ["\nRestart: ", inspect(restart), "\nShutdown: ", inspect(shutdown)] ++ +- ["\nType: ", inspect(type)] ++ defp child_debug(:debug, opts) do ++ for {key, value} <- opts do ++ child_debug_key(key, value) ++ end + end + + defp child_debug(_min_level, _child) do + [] + end + ++ defp child_debug_key(:restart_type, value), do: ["\nRestart: " | inspect(value)] ++ defp child_debug_key(:shutdown, value), do: ["\nShutdown: " | inspect(value)] ++ defp child_debug_key(:child_type, value), do: ["\nType: " | inspect(value)] ++ defp child_debug_key(:significant, value), do: if(value, do: "\nSignificant: true", else: []) ++ defp child_debug_key(_, _), do: [] ++ + defp report_crash(min_level, [[{:initial_call, initial_call} | crashed], linked]) do + mfa = initial_call_to_mfa(initial_call) + report_crash(min_level, crashed, [{:initial_call, mfa}], linked) +-- +2.31.1 + diff --git a/dev-lang/elixir/files/elixir-1.11.4-update-warnings-for-OTP-master-10807.patch b/dev-lang/elixir/files/elixir-1.11.4-update-warnings-for-OTP-master-10807.patch new file mode 100644 index 000000000000..2cc0b217cbb1 --- /dev/null +++ b/dev-lang/elixir/files/elixir-1.11.4-update-warnings-for-OTP-master-10807.patch @@ -0,0 +1,125 @@ +From 237a71311c5ae4fc5dd3c7a590a7b6dab97a664a Mon Sep 17 00:00:00 2001 +From: Wojtek Mach <wojtekmach@users.noreply.github.com> +Date: Tue, 23 Mar 2021 17:40:04 +0100 +Subject: [PATCH 2/3] Update warnings for OTP master (#10807) + +--- + lib/elixir/src/elixir_erl_compiler.erl | 34 ++++++++++++------- + .../test/elixir/kernel/warning_test.exs | 25 -------------- + 2 files changed, 21 insertions(+), 38 deletions(-) + +diff --git a/lib/elixir/src/elixir_erl_compiler.erl b/lib/elixir/src/elixir_erl_compiler.erl +index 7010b59fd..e0aa05114 100644 +--- a/lib/elixir/src/elixir_erl_compiler.erl ++++ b/lib/elixir/src/elixir_erl_compiler.erl +@@ -94,6 +94,8 @@ handle_file_warning(true, _File, {_Line, sys_core_fold, {nomatch_shadow, _}}) -> + + %% Those we implement ourselves + handle_file_warning(_, _File, {_Line, v3_core, {map_key_repeated, _}}) -> ok; ++handle_file_warning(_, _File, {_Line, sys_core_fold, {ignored, useless_building}}) -> ok; ++%% TODO: remove when we require Erlang/OTP 24 + handle_file_warning(_, _File, {_Line, sys_core_fold, useless_building}) -> ok; + + %% Ignore all linting errors (only come up on parse transforms) +@@ -112,11 +114,11 @@ handle_file_error(File, {Line, Module, Desc}) -> + elixir_errors:compile_error([{line, Line}], File, Message). + + %% Mention the capture operator in make_fun +-custom_format(sys_core_fold, {no_effect, {erlang, make_fun, 3}}) -> ++custom_format(sys_core_fold, {ignored, {no_effect, {erlang, make_fun, 3}}}) -> + "the result of the capture operator & (:erlang.make_fun/3) is never used"; + + %% Make no_effect clauses pretty +-custom_format(sys_core_fold, {no_effect, {erlang, F, A}}) -> ++custom_format(sys_core_fold, {ignored, {no_effect, {erlang, F, A}}}) -> + {Fmt, Args} = case erl_internal:comp_op(F, A) of + true -> {"use of operator ~ts has no effect", [elixir_utils:erlang_comparison_op_to_elixir(F)]}; + false -> +@@ -127,12 +129,20 @@ custom_format(sys_core_fold, {no_effect, {erlang, F, A}}) -> + end, + io_lib:format(Fmt, Args); + +-%% Rewrite nomatch_guard to be more generic it can happen inside if, unless, and the like +-custom_format(sys_core_fold, nomatch_guard) -> ++%% Rewrite nomatch to be more generic, it can happen inside if, unless, and the like ++custom_format(sys_core_fold, {nomatch, X}) when X == guard; X == no_clause -> + "this check/guard will always yield the same result"; + ++custom_format(sys_core_fold, {nomatch, {shadow, Line, {ErlName, ErlArity}}}) -> ++ {Name, Arity} = elixir_utils:erl_fa_to_elixir_fa(ErlName, ErlArity), ++ ++ io_lib:format( ++ "this clause for ~ts/~B cannot match because a previous clause at line ~B always matches", ++ [Name, Arity, Line] ++ ); ++ + %% Handle literal eval failures +-custom_format(sys_core_fold, {eval_failure, {Mod, Name, Arity}, Error}) -> ++custom_format(sys_core_fold, {failed, {eval_failure, {Mod, Name, Arity}, Error}}) -> + #{'__struct__' := Struct} = 'Elixir.Exception':normalize(error, Error), + {ExMod, ExName, ExArgs} = elixir_rewrite:erl_to_ex(Mod, Name, lists:duplicate(Arity, nil)), + Call = 'Elixir.Exception':format_mfa(ExMod, ExName, length(ExArgs)), +@@ -143,18 +153,16 @@ custom_format(sys_core_fold, {eval_failure, {Mod, Name, Arity}, Error}) -> + ["the call to ", Trimmed, " will fail with ", elixir_aliases:inspect(Struct)]; + + %% TODO: remove when we require OTP 24 ++custom_format(sys_core_fold, {nomatch_shadow, Line, FA}) -> ++ custom_format(sys_core_fold, {nomatch, {shadow, Line, FA}}); ++custom_format(sys_core_fold, nomatch_guard) -> ++ custom_format(sys_core_fold, {nomatch, guard}); ++custom_format(sys_core_fold, {no_effect, X}) -> ++ custom_format(sys_core_fold, {ignored, {no_effect, X}}); + custom_format(sys_core_fold, {eval_failure, Error}) -> + #{'__struct__' := Struct} = 'Elixir.Exception':normalize(error, Error), + ["this expression will fail with ", elixir_aliases:inspect(Struct)]; + +-custom_format(sys_core_fold, {nomatch_shadow,Line,{ErlName,ErlArity}}) -> +- {Name, Arity} = elixir_utils:erl_fa_to_elixir_fa(ErlName, ErlArity), +- +- io_lib:format( +- "this clause for ~ts/~B cannot match because a previous clause at line ~B always matches", +- [Name, Arity, Line] +- ); +- + custom_format([], Desc) -> + io_lib:format("~p", [Desc]); + +diff --git a/lib/elixir/test/elixir/kernel/warning_test.exs b/lib/elixir/test/elixir/kernel/warning_test.exs +index 15a984a54..37334ff65 100644 +--- a/lib/elixir/test/elixir/kernel/warning_test.exs ++++ b/lib/elixir/test/elixir/kernel/warning_test.exs +@@ -1154,31 +1154,6 @@ def foo(x), do: :ok + purge(Sample) + end + +- test "with and do clauses emit errors, else clauses do not" do +- assert capture_err(fn -> +- Code.compile_string(""" +- with {:first, int} when is_integer(int) <- {:second, Integer.gcd(2, 4)} do +- int +- end +- """) +- end) =~ "this clause cannot match" +- +- assert capture_err(fn -> +- Code.compile_string(""" +- with {:first, int1} when is_integer(int1) <- {:first, Integer.gcd(2, 4)}, +- {:second, int2} when is_integer(int2) <- {:second, Integer.gcd(2, 4)} do +- {:ok, int1 + int2} +- else +- {:first, nil} -> {:error, "first number is not integer"} +- {:second, nil} -> {:error, "second number is not integer"} +- end +- """) +- end) == "" +- after +- purge(Sample1) +- purge(Sample2) +- end +- + test "warning on code point escape" do + assert capture_err(fn -> + Code.eval_string("? ") +-- +2.31.1 + |