Commit 99ec752
authored
Backport OTP 24 compatibility patches to v1.11 (#10743)
* Update Erlang warnings translation (#10694)
Since erlang/otp@8ecc648
instead of `{eval_failure, Reason}` we'd get `{eval_failure, Call, Reason}`
* Fix translating erl compiler errors to diagnostics on OTP 24 (#10719)
The compiler previously emitted just `line` and now emits `{line,
column}`.
The diagnostic struct accepts as position either:
nil
line
{start_line, start_col, end_line, end_col}
so we could have used the `column` to create the 4-tuple but we don't
have enough information to do that correctly, we don't know where the
line ends.
* Fix remaining warning translations for OTP 24 (#10720)
Yecc error message changed so we need to loosen up our assertion:
OTP 23
iex> iex
Erlang/OTP 23 [erts-11.1.7] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Interactive Elixir (1.11.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :yecc.file('f.yrl')
f.yrl:1: syntax error before: '.'
:error
OTP 24
iex> iex
Erlang/OTP 24 [DEVELOPMENT] [erts-11.1.7] [source-802d2c5083] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Interactive Elixir (1.12.0-dev) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :yecc.file('f.yrl')
f.yrl:1:5: syntax error before: .
:error
* Support 16bit floats in bitstrings (#10740)
On OTP 24:
iex> <<x::float-16>> = <<60, 0>>
iex> x
1.0
iex> <<x::float-16>>
<<60, 0>>
Before OTP 24 we'd get errors or wouldn't match:
iex> <<1.0::float-16>>
** (ArgumentError) argument error while evaluating iex at line 1
<<x::float-16>> = <<60, 0>>
** (MatchError) no match of right hand side value: <<60, 0>>
iex> (fn <<x::float-16>> -> x; _ -> :nomatch end).(<<60, 0>>)
:nomatch
* Handle :compile.file/2 returning :error on OTP 24 (#10742)
Before OTP 24 when given invalid args, :compile.file/2 would return:
iex(1)> :compile.file('a.erl', [{:d, 'foo', 'bar'}, :report])
{:error, :badarg}
On OTP 24:
iex(1)> :compile.file('a.erl', [{:d, 'foo', 'bar'}, :report])
*** Internal compiler error ***
exception error: bad argument
in function io_lib:format/2
called as io_lib:format("badly formed '~s'",[{"foo","bar"}])
in call from sys_messages:list_errors/3 (sys_messages.erl, line 53)
in call from lists:foreach/2 (lists.erl, line 1342)
in call from compile:comp_ret_err/1 (compile.erl, line 546)
in call from compile:'-internal_fun/2-anonymous-0-'/2 (compile.erl, line 229)
in call from compile:'-do_compile/2-anonymous-0-'/1 (compile.erl, line 219)
:error1 parent d30c5c0 commit 99ec752
File tree
9 files changed
+96
-20
lines changed- lib
- elixir
- lib/kernel
- src
- test/elixir/kernel
- mix
- lib/mix
- compilers
- tasks
- test/mix/tasks
9 files changed
+96
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
323 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
324 | 329 | | |
325 | 330 | | |
326 | 331 | | |
| |||
331 | 336 | | |
332 | 337 | | |
333 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
334 | 345 | | |
335 | 346 | | |
336 | 347 | | |
| |||
372 | 383 | | |
373 | 384 | | |
374 | 385 | | |
375 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
376 | 392 | | |
377 | 393 | | |
378 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
135 | 146 | | |
136 | 147 | | |
137 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2387 | 2387 | | |
2388 | 2388 | | |
2389 | 2389 | | |
2390 | | - | |
2391 | | - | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
2392 | 2394 | | |
2393 | | - | |
2394 | | - | |
| 2395 | + | |
| 2396 | + | |
2395 | 2397 | | |
2396 | 2398 | | |
2397 | | - | |
| 2399 | + | |
| 2400 | + | |
2398 | 2401 | | |
2399 | | - | |
2400 | | - | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
2401 | 2433 | | |
2402 | 2434 | | |
2403 | 2435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
934 | 943 | | |
935 | 944 | | |
936 | 945 | | |
937 | 946 | | |
938 | 947 | | |
939 | 948 | | |
940 | 949 | | |
941 | | - | |
| 950 | + | |
942 | 951 | | |
943 | 952 | | |
944 | 953 | | |
945 | 954 | | |
946 | 955 | | |
947 | 956 | | |
948 | 957 | | |
949 | | - | |
| 958 | + | |
950 | 959 | | |
951 | 960 | | |
952 | 961 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
294 | 299 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | | - | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
0 commit comments