Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

Refresh all snapshots

+32 -3219
-1
compiler-core/src/docs/snapshots/gleam_core__docs__tests__discarded_arguments_are_not_shown.snap
··· 1 1 --- 2 2 source: compiler-core/src/docs/tests.rs 3 - assertion_line: 134 4 3 expression: "compile(config, modules)" 5 4 --- 6 5 //// app.html
-1
compiler-core/src/docs/snapshots/gleam_core__docs__tests__hello_docs.snap
··· 1 1 --- 2 2 source: compiler-core/src/docs/tests.rs 3 - assertion_line: 28 4 3 expression: "compile(config, modules)" 5 4 --- 6 5 //// app.html
-1
compiler-core/src/docs/snapshots/gleam_core__docs__tests__long_function_wrapping.snap
··· 1 1 --- 2 2 source: compiler-core/src/docs/tests.rs 3 - assertion_line: 76 4 3 expression: "compile(config, modules)" 5 4 --- 6 5 //// app.html
-1
compiler-core/src/docs/snapshots/gleam_core__docs__tests__tables.snap
··· 1 1 --- 2 2 source: compiler-core/src/docs/tests.rs 3 - assertion_line: 49 4 3 expression: "compile(config, modules)" 5 4 --- 6 5 //// app.html
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__allowed_string_escapes.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 466 4 3 expression: "pub fn a() { \"\\n\" \"\\r\" \"\\t\" \"\\\\\" \"\\\"\" \"\\\\^\" }" 5 4 --- 6 5 -module(my@mod). ··· 16 15 <<"\\"/utf8>>, 17 16 <<"\""/utf8>>, 18 17 <<"\\^"/utf8>>. 19 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__binop_parens.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 360 4 3 expression: "\npub fn main() {\n let a = 2 * {3 + 1} / 2\n let b = 5 + 3 / 3 * 2 - 6 * 4\n b\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 13 12 A = (2 * (3 + 1)) div 2, 14 13 B = (5 + ((3 div 3) * 2)) - (6 * 4), 15 14 B. 16 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__block_assignment.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 404 4 3 expression: "\npub fn main() {\n let x = {\n 1\n 2\n }\n x\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 2 16 15 end, 17 16 X. 18 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__discard_in_assert.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 483 4 3 expression: "pub fn x(y) {\n let assert Ok(_) = y\n 1\n}" 5 4 --- 6 5 -module(my@mod). ··· 21 20 line => 2}) 22 21 end, 23 22 1. 24 -
-4
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__dynamic.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 578 4 3 expression: pub type Dynamic 5 4 --- 6 5 -module(my@mod). ··· 9 8 -export_type([dynamic_/0]). 10 9 11 10 -type dynamic_() :: any(). 12 - 13 - 14 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__field_access_function_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 374 4 3 expression: "\ntype FnBox {\n FnBox(f: fn(Int) -> Int)\n}\nfn main() {\n let b = FnBox(f: fn(x) { x })\n b.f(5)\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 14 13 main() -> 15 14 B = {fn_box, fun(X) -> X end}, 16 15 (erlang:element(2, B))(5). 17 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__field_access_function_call1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 390 4 3 expression: "\npub fn main() {\n let t = #(fn(x) { x })\n\n t.0(5)\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 main() -> 13 12 T = {fun(X) -> X end}, 14 13 (erlang:element(1, T))(5). 15 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__function_argument_shadowing.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 563 4 3 expression: "pub fn main(a) {\n Box\n}\n\npub type Box {\n Box(Int)\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 14 13 -spec main(any()) -> fun((integer()) -> box()). 15 14 main(A) -> 16 15 fun(Field@0) -> {box, Field@0} end. 17 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__guard_variable_rewriting.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 550 4 3 expression: "pub fn main() {\n case 1.0 {\n a if a <. 0.0 -> {\n let a = a\n a\n }\n _ -> 0.0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 +0.0 20 19 end. 21 -
+1 -3
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__inline_const_pattern_option.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 584 4 - expression: "pub fn main() {\n let fifteen = 15\n let x = <<5:size(sixteen)>>\n case x {\n <<5:size(sixteen)>> -> <<5:size(sixteen)>>\n <<6:size(fifteen)>> -> <<5:size(fifteen)>>\n _ -> <<>>\n }\n }\n \n pub const sixteen = 16" 3 + expression: "pub fn main() {\n let fifteen = 15\n let x = <<5:size(sixteen)>>\n case x {\n <<5:size(sixteen)>> -> <<5:size(sixteen)>>\n <<6:size(fifteen)>> -> <<5:size(fifteen)>>\n _ -> <<>>\n }\n }\n\n pub const sixteen = 16" 5 4 --- 6 5 -module(my@mod). 7 6 -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). ··· 22 21 _ -> 23 22 <<>> 24 23 end. 25 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 96 4 3 expression: "pub fn go() {\nlet x = #(100000000000000000, #(2000000000, 3000000000000, 40000000000), 50000, 6000000000)\n x\n}" 5 4 --- 6 5 -module(my@mod). ··· 18 17 50000, 19 18 6000000000}, 20 19 X. 21 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test0_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 106 4 3 expression: "pub fn go() {\n let y = 1\n let y = 2\n y\n}" 5 4 --- 6 5 -module(my@mod). ··· 13 12 Y = 1, 14 13 Y@1 = 2, 15 14 Y@1. 16 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test0_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 118 4 3 expression: "pub fn go() {\n let fifteen = 0xF\n let nine = 0o11\n let ten = 0b1010\n fifteen\n}" 5 4 --- 6 5 -module(my@mod). ··· 14 13 Nine = 8#11, 15 14 Ten = 2#1010, 16 15 Fifteen. 17 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test0_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 130 4 3 expression: "pub fn go() {\n let y = 1\n let y = 2\n y\n}" 5 4 --- 6 5 -module(my@mod). ··· 13 12 Y = 1, 14 13 Y@1 = 2, 15 14 Y@1. 16 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 141 4 3 expression: "pub fn t() { True }" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec t() -> boolean(). 12 11 t() -> 13 12 true. 14 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test10.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 226 4 3 expression: "type Null { Null } fn x() { Null }" 5 4 --- 6 5 -module(my@mod). ··· 13 12 -spec x() -> null(). 14 13 x() -> 15 14 null. 16 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test11.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 239 4 3 expression: "type Point { Point(x: Int, y: Int) }\n fn x() { Point(x: 4, y: 6) Point(y: 1, x: 9) }" 5 4 --- 6 5 -module(my@mod). ··· 14 13 x() -> 15 14 {point, 4, 6}, 16 15 {point, 9, 1}. 17 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test12.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 247 4 3 expression: "type Point { Point(x: Int, y: Int) } fn x(y) { let Point(a, b) = y a }" 5 4 --- 6 5 -module(my@mod). ··· 14 13 x(Y) -> 15 14 {point, A, B} = Y, 16 15 A. 17 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test13.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 253 4 3 expression: "pub type State{ Start(Int) End(Int) }\n pub fn build(constructor : fn(Int) -> a) -> a { constructor(1) }\n pub fn main() { build(End) }" 5 4 --- 6 5 -module(my@mod). ··· 18 17 -spec main() -> state(). 19 18 main() -> 20 19 build(fun(Field@0) -> {'end', Field@0} end). 21 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test16.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 262 4 3 expression: "fn go(x xx, y yy) { xx }\npub fn x() { go(x: 1, y: 2) go(y: 3, x: 4) }" 5 4 --- 6 5 -module(my@mod). ··· 16 15 x() -> 17 16 go(1, 2), 18 17 go(4, 3). 19 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test17.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 271 4 3 expression: "\ntype User { User(id: Int, name: String, age: Int) }\nfn create_user(user_id) { User(age: 22, id: user_id, name: \"\") }\n " 5 4 --- 6 5 -module(my@mod). ··· 13 12 -spec create_user(integer()) -> user(). 14 13 create_user(User_id) -> 15 14 {user, User_id, <<""/utf8>>, 22}. 16 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test18.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 281 4 3 expression: "pub fn run() { case 1, 2 { a, b -> a } }" 5 4 --- 6 5 -module(my@mod). ··· 14 13 {A, B} -> 15 14 A 16 15 end. 17 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test19.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 286 4 3 expression: "type X { X(x: Int, y: Float) }\n fn x() { X(x: 1, y: 2.) X(y: 3., x: 4) }" 5 4 --- 6 5 -module(my@mod). ··· 14 13 x() -> 15 14 {x, 1, 2.0}, 16 15 {x, 4, 3.0}. 17 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test1_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 146 4 3 expression: "pub type Money { Pound(Int) }\n fn pound(x) { Pound(x) }" 5 4 --- 6 5 -module(my@mod). ··· 13 12 -spec pound(integer()) -> money(). 14 13 pound(X) -> 15 14 {pound, X}. 16 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test1_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 154 4 3 expression: "pub fn loop() { loop() }" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec loop() -> any(). 12 11 loop() -> 13 12 loop(). 14 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test1_4.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 159 4 3 expression: "fn inc(x) { x + 1 }\n pub fn go() { 1 |> inc |> inc |> inc }" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _pipe@1 = inc(_pipe), 19 18 _pipe@2 = inc(_pipe@1), 20 19 inc(_pipe@2). 21 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test1_5.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 167 4 3 expression: "fn add(x, y) { x + y }\n pub fn go() { 1 |> add(_, 1) |> add(2, _) |> add(_, 3) }" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _pipe@1 = add(_pipe, 1), 19 18 _pipe@2 = add(2, _pipe@1), 20 19 add(_pipe@2, 3). 21 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test1_6.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 175 4 3 expression: "pub fn and(x, y) { x && y }\npub fn or(x, y) { x || y }\npub fn remainder(x, y) { x % y }\npub fn fdiv(x, y) { x /. y }\n " 5 4 --- 6 5 -module(my@mod). ··· 30 29 -0.0 -> -0.0; 31 30 Gleam@denominator -> X / Gleam@denominator 32 31 end. 33 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 186 4 3 expression: "pub fn second(list) { case list { [x, y] -> y z -> 1 } }\npub fn tail(list) { case list { [x, ..xs] -> xs z -> list } }\n " 5 4 --- 6 5 -module(my@mod). ··· 27 26 Z -> 28 27 List 29 28 end. 30 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test20.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 294 4 3 expression: "\npub fn go(a) {\n let a = a + 1\n a\n}\n\n " 5 4 --- 6 5 -module(my@mod). ··· 12 11 go(A) -> 13 12 A@1 = A + 1, 14 13 A@1. 15 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test21.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 307 4 3 expression: "\npub fn go(a) {\n let a = 1\n a\n}\n\n " 5 4 --- 6 5 -module(my@mod). ··· 12 11 go(A) -> 13 12 A@1 = 1, 14 13 A@1. 15 -
-1
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test22.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 332 4 3 expression: "\npub fn factory(f, i) {\n f(i)\n}\n\npub type Box {\n Box(i: Int)\n}\n\npub fn main() {\n factory(Box, 0)\n}\n" 5 4 --- 6 5 -module(my@mod).
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test23.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 341 4 3 expression: "\npub fn main(args) {\n case args {\n _ -> {\n let a = 1\n a\n }\n }\n let a = 2\n a\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 end, 18 17 A@1 = 2, 19 18 A@1. 20 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 231 4 3 expression: "type Point { Point(x: Int, y: Int) }\n fn y() { fn() { Point }()(4, 6) }" 5 4 --- 6 5 -module(my@mod). ··· 16 15 4, 17 16 6 18 17 ). 19 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test5.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 195 4 3 expression: "pub fn tail(list) {\n case list {\n [x, ..] -> x\n _ -> 0\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test6.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 207 4 3 expression: "pub fn x() { let x = 1 let x = x + 1 x }" 5 4 --- 6 5 -module(my@mod). ··· 13 12 X = 1, 14 13 X@1 = X + 1, 15 14 X@1. 16 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test8.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 213 4 3 expression: "pub fn x() { 1. <. 2.3 }" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec x() -> boolean(). 12 11 x() -> 13 12 1.0 < 2.3. 14 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__integration_test9.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 219 4 3 expression: "pub type Pair(x, y) { Pair(x: x, y: y) } pub fn x() { Pair(1, 2) Pair(3., 4.) }" 5 4 --- 6 5 -module(my@mod). ··· 15 14 x() -> 16 15 {pair, 1, 2}, 17 16 {pair, 3.0, 4.0}. 18 -
-4
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__keyword_constructors.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 472 4 3 expression: "pub type X { Div }" 5 4 --- 6 5 -module(my@mod). ··· 9 8 -export_type([x/0]). 10 9 11 10 -type x() :: 'div'. 12 - 13 - 14 -
-4
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__keyword_constructors1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 478 4 3 expression: "pub type X { Fun(Int) }" 5 4 --- 6 5 -module(my@mod). ··· 9 8 -export_type([x/0]). 10 9 11 10 -type x() :: {'fun', integer()}. 12 - 13 - 14 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__negation.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 507 4 3 expression: "pub fn negate(x) {\n !x\n}" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec negate(boolean()) -> boolean(). 12 11 negate(X) -> 13 12 not X. 14 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__negation_block.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 516 4 3 expression: "pub fn negate(x) {\n !{\n 123\n x\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 14 13 123, 15 14 X 16 15 end. 17 -
+1 -3
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__operator_pipe_right_hand_side.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 494 4 - expression: "fn id(x) {\n x\n}\n \npub fn bool_expr(x, y) {\n y || x |> id \n}" 3 + expression: "fn id(x) {\n x\n}\n\npub fn bool_expr(x, y) {\n y || x |> id\n}" 5 4 --- 6 5 -module(my@mod). 7 6 -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). ··· 18 17 _pipe = X, 19 18 id(_pipe) 20 19 end. 21 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__positive_zero.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 602 4 3 expression: "\npub fn main() {\n 0.0\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> float(). 12 11 main() -> 13 12 +0.0. 14 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__recursive_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 422 4 3 expression: "\nfn id(x) {\n x\n}\n\npub fn main() {\n id(id)\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 -spec main() -> fun((M) -> M). 16 15 main() -> 17 16 id(fun id/1). 18 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__tail_maybe_expr_block.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 529 4 3 expression: "pub fn a() {\n let fake_tap = fn(x) { x }\n let b = [99]\n [\n 1,\n 2,\n ..b\n |> fake_tap\n ]\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _pipe = B, 19 18 Fake_tap(_pipe) 20 19 end]. 21 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__tuple_access_in_guard.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 437 4 3 expression: "\npub fn main() {\n let key = 10\n let x = [#(10, 2), #(1, 2)]\n case x {\n [first, ..rest] if first.0 == key -> \"ok\"\n _ -> \"ko\"\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 19 18 _ -> 20 19 <<"ko"/utf8>> 21 20 end. 22 -
-2
compiler-core/src/erlang/snapshots/gleam_core__erlang__tests__variable_name_underscores_preserved.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests.rs 3 - assertion_line: 453 4 3 expression: "pub fn a(name_: String) -> String {\n let name__ = name_\n let name = name__\n let one_1 = 1\n let one1 = one_1\n name\n}" 5 4 --- 6 5 -module(my@mod). ··· 15 14 One_1 = 1, 16 15 One1 = One_1, 17 16 Name. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 5 4 3 expression: "pub fn main() {\n let a = 1\n let simple = <<1, a>>\n let complex = <<4:int-big, 5.0:little-float, 6:native-int>>\n let assert <<7:2, 8:size(3), b:bytes-size(4)>> = <<1>>\n let assert <<c:8-unit(1), d:bytes-size(2)-unit(2)>> = <<1>>\n\n simple\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 36 35 line => 6}) 37 36 end, 38 37 Simple. 39 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 32 4 3 expression: "pub fn x() { 2 }\nfn main() {\n let a = -1\n let b = <<a:unit(2)-size(a * 2), a:size(3 + x())-unit(1)>>\n\n b\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 B = <<A:(lists:max([(A * 2), 0]))/unit:2, 19 18 A:(lists:max([(3 + x()), 0]))/unit:1>>, 20 19 B. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 46 4 3 expression: "pub fn main() {\n let a = 1\n let assert <<b, 1>> = <<1, a>>\n b\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 23 22 line => 3}) 24 23 end, 25 24 B. 26 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 58 4 3 expression: "pub fn main() {\n let a = <<\"test\":utf8>>\n let assert <<b:utf8_codepoint, \"st\":utf8>> = a\n b\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 22 21 line => 3}) 23 22 end, 24 23 B. 25 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array4.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 70 4 3 expression: "fn x() { 1 }\npub fn main() {\n let a = <<x():int>>\n a\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 16 15 main() -> 17 16 A = <<(x())/integer>>, 18 17 A. 19 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array5.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 82 4 3 expression: "const bit_size = 8\npub fn main() {\n let a = <<10:size(bit_size)>>\n a\n}\n" 5 4 --- 6 5 -module(my@mod).
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array_declare_and_use_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 112 4 3 expression: "pub fn go(x) {\n let assert <<name_size:8, name:bytes-size(name_size)>> = x\n name\n}" 5 4 --- 6 5 -module(my@mod). ··· 21 20 line => 2}) 22 21 end, 23 22 Name. 24 -
+1 -3
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array_discard.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 84 4 - expression: "\npub fn bit_array_discard(x) -> Bool {\n case x {\n <<_:utf8, rest:binary>> -> True\n _ -> False\n }\n}\n " 3 + expression: "\npub fn bit_array_discard(x) -> Bool {\n case x {\n <<_:utf8, rest:bytes>> -> True\n _ -> False\n }\n}\n " 5 4 --- 6 5 -module(my@mod). 7 6 -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). ··· 17 16 _ -> 18 17 false 19 18 end. 20 -
+1 -3
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array_discard1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 98 4 - expression: "\npub fn bit_array_discard(x) -> Bool {\n case x {\n <<_discardme:utf8, rest:binary>> -> True\n _ -> False\n }\n}\n " 3 + expression: "\npub fn bit_array_discard(x) -> Bool {\n case x {\n <<_discardme:utf8, rest:bytes>> -> True\n _ -> False\n }\n}\n" 5 4 --- 6 5 -module(my@mod). 7 6 -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). ··· 17 16 _ -> 18 17 false 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_array_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 21 4 3 expression: "pub fn main() {\n let b = 16\n let floats = <<1.0:16-float, 5.0:float-32, 6.0:float-64-little, 1.0:float-size(b)>>\n let assert <<1.0:16-float, 5.0:float-32, 6.0:float-64-little, 1.0:float-size(b)>> = floats \n}" 5 4 --- 6 5 -module(my@mod). ··· 25 24 function => <<"main"/utf8>>, 26 25 line => 4}) 27 26 end. 28 -
-15
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_string_declare_and_use_var.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 112 4 - expression: "pub fn go(x) {\n let <<name_size:8, name:binary-size(name_size)>> = x\n name\n}" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([go/1]). 10 - 11 - -spec go(bitstring()) -> bitstring(). 12 - go(X) -> 13 - <<Name_size:8, Name:Name_size/binary>> = X, 14 - Name. 15 -
-20
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_string_discard.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 84 4 - expression: "\npub fn bitstring_discard(x) -> Bool {\n case x {\n <<_:utf8, rest:binary>> -> True\n _ -> False\n }\n}\n " 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([bitstring_discard/1]). 10 - 11 - -spec bitstring_discard(bitstring()) -> boolean(). 12 - bitstring_discard(X) -> 13 - case X of 14 - <<_/utf8, Rest/binary>> -> 15 - true; 16 - 17 - _ -> 18 - false 19 - end. 20 -
-20
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_string_discard1.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 98 4 - expression: "\npub fn bitstring_discard(x) -> Bool {\n case x {\n <<_discardme:utf8, rest:binary>> -> True\n _ -> False\n }\n}\n " 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([bitstring_discard/1]). 10 - 11 - -spec bitstring_discard(bitstring()) -> boolean(). 12 - bitstring_discard(X) -> 13 - case X of 14 - <<_/utf8, Rest/binary>> -> 15 - true; 16 - 17 - _ -> 18 - false 19 - end. 20 -
-19
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_strings.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 5 4 - expression: "pub fn main() {\n let a = 1\n let simple = <<1, a>>\n let complex = <<4:int-big, 5.0:little-float, 6:native-int>>\n let <<7:2, 8:size(3), b:binary-size(4)>> = <<1>>\n let <<c:8-unit(1), d:binary-size(2)-unit(2)>> = <<1>>\n\n simple\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([main/0]). 10 - 11 - -spec main() -> bitstring(). 12 - main() -> 13 - A = 1, 14 - Simple = <<1, A>>, 15 - Complex = <<4/integer-big, 5.0/little-float, 6/native-integer>>, 16 - <<7:2, 8:3, B:4/binary>> = <<1>>, 17 - <<C:8/unit:1, D:2/binary-unit:2>> = <<1>>, 18 - Simple. 19 -
-21
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_strings1.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 32 4 - expression: "pub fn x() { 2 }\nfn main() {\n let a = -1\n let b = <<a:unit(2)-size(a * 2), a:size(3 + x())-unit(1)>>\n\n b\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([x/0]). 10 - 11 - -spec x() -> integer(). 12 - x() -> 13 - 2. 14 - 15 - -spec main() -> bitstring(). 16 - main() -> 17 - A = -1, 18 - B = <<A:(lists:max([(A * 2), 0]))/unit:2, 19 - A:(lists:max([(3 + x()), 0]))/unit:1>>, 20 - B. 21 -
-16
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_strings2.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 46 4 - expression: "pub fn main() {\n let a = 1\n let <<b, 1>> = <<1, a>>\n b\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([main/0]). 10 - 11 - -spec main() -> integer(). 12 - main() -> 13 - A = 1, 14 - <<B, 1>> = <<1, A>>, 15 - B. 16 -
-16
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_strings3.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 58 4 - expression: "pub fn main() {\n let a = <<\"test\":utf8>>\n let <<b:utf8_codepoint, \"st\":utf8>> = a\n b\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([main/0]). 10 - 11 - -spec main() -> integer(). 12 - main() -> 13 - A = <<"test"/utf8>>, 14 - <<B/utf8, "st"/utf8>> = A, 15 - B. 16 -
-19
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_strings4.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 70 4 - expression: "fn x() { 1 }\npub fn main() {\n let a = <<x():int>>\n a\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([main/0]). 10 - 11 - -spec x() -> integer(). 12 - x() -> 13 - 1. 14 - 15 - -spec main() -> bitstring(). 16 - main() -> 17 - A = <<(x())/integer>>, 18 - A. 19 -
-19
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__bit_arrays__bit_strings_float.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/bit_arrays.rs 3 - assertion_line: 21 4 - expression: "pub fn main() {\n let b = 16\n let floats = <<1.0:16-float, 5.0:float-32, 6.0:float-64-little, 1.0:float-size(b)>>\n let <<1.0:16-float, 5.0:float-32, 6.0:float-64-little, 1.0:float-size(b)>> = floats \n}" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([main/0]). 10 - 11 - -spec main() -> bitstring(). 12 - main() -> 13 - B = 16, 14 - Floats = <<1.0:16/float, 15 - 5.0:32/float, 16 - 6.0:64/float-little, 17 - 1.0:(lists:max([(B), 0]))/float>>, 18 - <<1.0:16/float, 5.0:32/float, 6.0:64/float-little, 1.0:B/float>> = Floats. 19 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__alternative_pattern_variable_rewriting.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 6 4 3 expression: "\npub fn myfun(mt) {\n case mt {\n 1 | _ ->\n 1\n |> Ok\n }\n 1\n |> Ok\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 21 20 end, 22 21 _pipe@1 = 1, 23 22 {ok, _pipe@1}. 24 -
-20
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__just_zero_pattern.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 54 4 - expression: "\npub fn main(x) {\n case x {\n 0 -> 1\n _ -> 2\n }\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars]). 8 - 9 - -export([main/1]). 10 - 11 - -spec main(integer()) -> integer(). 12 - main(X) -> 13 - case X of 14 - 0 -> 15 - 1; 16 - 17 - _ -> 18 - 2 19 - end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__negative_zero_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 39 4 3 expression: "\npub fn main(x) {\n case x {\n -0.0 -> 1\n _ -> 2\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 2 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__not.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 53 4 3 expression: "pub fn main(x, y) {\n case x {\n _ if !y -> 0\n _ -> 1\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 1 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__not_two.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 66 4 3 expression: "pub fn main(x, y) {\n case x {\n _ if !y && !x -> 0\n _ -> 1\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 1 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__positive_zero_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 24 4 3 expression: "\npub fn main(x) {\n case x {\n 0.0 -> 1\n _ -> 2\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 2 19 18 end. 20 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__spread_empty_list.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 79 4 3 expression: "\npub fn main() {\n case [] {\n [..] -> 1\n }\n}\n" 5 4 --- 6 5 -module(my@mod).
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__case__spread_empty_list_assigning.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/case.rs 3 - assertion_line: 94 4 3 expression: "\npub fn main() {\n case [] {\n [..rest] -> rest\n }\n}\n" 5 4 --- 6 5 -module(my@mod).
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__conditional_compilation__excluded_attribute_syntax.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/conditional_compilation.rs 3 - assertion_line: 5 4 3 expression: "@target(javascript)\n pub fn main() { 1 }\n" 5 4 --- 6 5 -module(my@mod). 7 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__conditional_compilation__included_attribute_syntax.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/conditional_compilation.rs 3 - assertion_line: 14 4 3 expression: "@target(erlang)\n pub fn main() { 1 }\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> integer(). 12 11 main() -> 13 12 1. 14 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__const_generalise.snap
··· 15 15 main() -> 16 16 Num = identity(1), 17 17 Word = identity(<<"Word"/utf8>>). 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__const_type_variable.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 40 4 3 expression: "\nfn identity(a: a) -> a {\n a\n}\n\nconst id: fn(a) -> a = identity\n" 5 4 --- 6 5 -module(my@mod). 7 -
-13
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__import_const_equal_to_record_with_private_function_field.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/consts.rs 3 - expression: "\n import mappers\n\n pub fn main() {\n mappers.id_mapper\n }\n " 4 - --- 5 - -module(my@mod). 6 - -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). 7 - 8 - -export([main/0]). 9 - 10 - -spec main() -> mappers:mapper(any()). 11 - main() -> 12 - {mapper, fun mappers:identity/1}. 13 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__pub_const_equal_to_private_function.snap
··· 10 10 -spec identity(I) -> I. 11 11 identity(A) -> 12 12 A. 13 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__pub_const_equal_to_record_with_nested_private_function_field.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 100 4 3 expression: "\n fn identity(a) {\n a\n }\n\n pub type Mapper(b) {\n Mapper(fn(b) -> b)\n }\n\n pub type Funcs(b) {\n Funcs(mapper: Mapper(b))\n }\n\n pub const id_mapper = Funcs(Mapper(identity))\n " 5 4 --- 6 5 -module(my@mod).
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__pub_const_equal_to_record_with_private_function_field.snap
··· 13 13 -spec identity(J) -> J. 14 14 identity(A) -> 15 15 A. 16 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__record_constructor.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 6 4 3 expression: "\npub type X {\n X(Int)\n}\n\npub const z = X\n\npub fn main() {\n z\n}" 5 4 --- 6 5 -module(my@mod). ··· 14 13 -spec main() -> fun((integer()) -> x()). 15 14 main() -> 16 15 fun(Field@0) -> {x, Field@0} end. 17 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__record_constructor_in_tuple.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 23 4 3 expression: "\npub type X {\n X(Int)\n}\n\npub const z = #(X)\n\npub fn main() {\n z\n}" 5 4 --- 6 5 -module(my@mod). ··· 14 13 -spec main() -> {fun((integer()) -> x())}. 15 14 main() -> 16 15 {fun(Field@0) -> {x, Field@0} end}. 17 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__use_private_in_internal.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 168 4 3 expression: "\n fn identity(a) {\n a\n }\n\n pub type Mapper(b) {\n Mapper(fn(b) -> b)\n }\n\n @internal\n pub const id_mapper = Mapper(identity)\n " 5 4 --- 6 5 -module(my@mod).
-13
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__use_qualified_pub_const_equal_to_private_function.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/consts.rs 3 - expression: "\n import mappers\n\n pub fn main() {\n mappers.id\n }\n " 4 - --- 5 - -module(my@mod). 6 - -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). 7 - 8 - -export([main/0]). 9 - 10 - -spec main() -> fun((N) -> N). 11 - main() -> 12 - fun mappers:identity/1. 13 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__use_qualified_pub_const_equal_to_record_with_private_function_field.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 151 4 3 expression: "\n fn identity(a) {\n a\n }\n\n pub type Mapper(b) {\n Mapper(fn(b) -> b)\n }\n\n pub const id_mapper = Mapper(identity)\n " 5 4 --- 6 5 -module(my@mod).
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__use_unqualified_pub_const_equal_to_private_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 121 4 3 expression: "\n fn identity(a) {\n a\n }\n\n pub const id = identity\n " 5 4 --- 6 5 -module(my@mod).
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__consts__use_unqualified_pub_const_equal_to_record_with_private_function_field.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/consts.rs 3 - assertion_line: 134 4 3 expression: "\n fn identity(a) {\n a\n }\n\n pub type Mapper(b) {\n Mapper(fn(b) -> b)\n }\n\n pub const id_mapper = Mapper(identity)\n " 5 4 --- 6 5 -module(my@mod).
-4
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__custom_types__phantom.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/custom_types.rs 3 - assertion_line: 5 4 3 expression: "pub type Map(k, v)" 5 4 --- 6 5 -module(my@mod). ··· 9 8 -export_type([map_/2]). 10 9 11 10 -type map_(I, J) :: any() | {gleam_phantom, I, J}. 12 - 13 - 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__attribute_erlang.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 105 4 3 expression: "\n@external(erlang, \"one\", \"one\")\npub fn one(x: Int) -> Int {\n todo\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec one(integer()) -> integer(). 12 11 one(X) -> 13 12 one:one(X). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__attribute_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 117 4 3 expression: "\n@external(javascript, \"./one.mjs\", \"one\")\npub fn one(x: Int) -> Int {\n todo\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 module => <<"my/mod"/utf8>>, 16 15 function => <<"one"/utf8>>, 17 16 line => 4}). 18 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__both_externals_no_valid_impl.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 304 4 3 expression: "\n@external(javascript, \"one\", \"one\")\npub fn js() -> Nil\n\n@external(erlang, \"one\", \"one\")\npub fn erl() -> Nil\n\npub fn should_not_be_generated() {\n js()\n erl()\n}\n" 5 4 --- 6 5 -module(my@mod).
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__elixir.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 247 4 3 expression: "\npub fn main() {\n #(do, do())\n}\n\n@external(erlang, \"Elixir.String\", \"main\")\nfn do() -> Int\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> {fun(() -> integer()), integer()}. 12 11 main() -> 13 12 {fun 'Elixir.String':main/0, 'Elixir.String':main()}. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__erlang_and_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 129 4 3 expression: "\n@external(erlang, \"one\", \"one\")\n@external(javascript, \"./one.mjs\", \"one\")\npub fn one(x: Int) -> Int {\n todo\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec one(integer()) -> integer(). 12 11 one(X) -> 13 12 one:one(X). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__hole_parameter_erlang.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 166 4 3 expression: "\n@external(erlang, \"one\", \"one\")\npub fn one(x: List(_)) -> Int {\n todo\n}\n" 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__hole_parameter_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 190 4 3 expression: "\n@external(javascript, \"one\", \"one\")\npub fn one(x: List(_)) -> Int {\n todo\n}\n" 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__hole_return_erlang.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 178 4 3 expression: "\n@external(erlang, \"one\", \"one\")\npub fn one(x: List(Int)) -> List(_) {\n todo\n}\n" 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__hole_return_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 202 4 3 expression: "\n@external(javascript, \"one\", \"one\")\npub fn one(x: List(Int)) -> List(_) {\n todo\n}\n" 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__inlining_external_functions_from_another_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 63 4 3 expression: "import atom\npub fn main() {\n atom.make(\"ok\")\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> binary(). 12 11 main() -> 13 12 erlang:binary_to_atom(<<"ok"/utf8>>). 14 -
+1 -3
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__integration_test1_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 5 4 - expression: "\n@external(erlang, \"Elixir.MyApp\", \"run\")\npub fn run() -> Int \n" 3 + expression: "\n@external(erlang, \"Elixir.MyApp\", \"run\")\npub fn run() -> Int\n" 5 4 --- 6 5 -module(my@mod). 7 6 -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). ··· 11 10 -spec run() -> integer(). 12 11 run() -> 13 12 'Elixir.MyApp':run(). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__integration_test7.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 15 4 3 expression: "\n@external(erlang, \"try\", \"and\")\npub fn receive() -> Int\npub fn catch(x) { receive() }\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 -spec 'catch'(any()) -> integer(). 16 15 'catch'(X) -> 17 16 'try':'and'(). 18 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__javascript_only.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 271 4 3 expression: "\npub fn should_be_generated(x: Int) -> Int {\n x\n}\n\n@external(javascript, \"one\", \"one\")\npub fn should_not_be_generated(x: Int) -> Int\n" 5 4 --- 6 5 -module(my@mod).
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__javascript_only_indirect.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 285 4 3 expression: "\npub fn should_be_generated(x: Int) -> Int {\n x\n}\n\n@external(javascript, \"one\", \"one\")\npub fn should_not_be_generated(x: Int) -> Int\n\npub fn also_should_not_be_generated() {\n should_not_be_generated(1)\n |> should_be_generated\n}\n" 5 4 --- 6 5 -module(my@mod).
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__no_body.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 214 4 3 expression: "\n@external(erlang, \"one\", \"one\")\npub fn one(x: Int) -> Int\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec one(integer()) -> integer(). 12 11 one(X) -> 13 12 one:one(X). 14 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__no_body_or_implementation.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 224 4 3 expression: "\npub fn one(x: Int) -> Float\n" 5 4 --- 6 5 error: Function without an implementation
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__no_gleam_impl_no_annotations_function_fault_tolerance.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 323 4 3 expression: "\n@external(erlang, \"one\", \"two\")\npub fn no_impl()\n\npub type X = UnknownType\n" 5 4 --- 6 5 error: Missing type annotation
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__no_target_supported_function_fault_tolerance.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 336 4 3 expression: "\n// This will error for having no support on this platform\n@external(erlang, \"one\", \"two\")\npub fn no_impl() -> Int\n\npub fn main() {\n // This will due to no_impl not having an appropriate implementation for the\n // target, NOT because it doesn't exist. The analyser should still know about\n // it, even though it is invalid.\n no_impl()\n}\n" 5 4 --- 6 5 error: Unsupported target
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__no_type_annotation_for_parameter.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 142 4 3 expression: "\n@external(erlang, \"one\", \"one\")\npub fn one(x: Int, y) -> Int {\n todo\n}\n" 5 4 --- 6 5 error: Missing type annotation ··· 13 12 14 13 Functions with external implementations must have type annotations 15 14 so we can tell what type of values they accept and return. 16 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__no_type_annotation_for_return.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 154 4 3 expression: "\n@external(erlang, \"one\", \"one\")\npub fn one(x: Int) {\n todo\n}\n" 5 4 --- 6 5 error: Missing type annotation ··· 13 12 14 13 Functions with external implementations must have type annotations 15 14 so we can tell what type of values they accept and return. 16 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__private.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 233 4 3 expression: "\npub fn main() {\n do()\n}\n\n@external(erlang, \"library\", \"main\")\nfn do() -> Int\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> integer(). 12 11 main() -> 13 12 library:main(). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__private_external_function_calls.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 27 4 3 expression: "\n@external(erlang, \"m\", \"f\")\nfn go(x x: Int, y y: Int) -> Int\n\npub fn x() { go(x: 1, y: 2) go(y: 3, x: 4) }" 5 4 --- 6 5 -module(my@mod). ··· 12 11 x() -> 13 12 m:f(1, 2), 14 13 m:f(4, 3). 15 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__private_local_function_references.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 52 4 3 expression: "\n@external(erlang, \"m\", \"f\")\nfn go(x: Int, y: Int) -> Int\npub fn x() { go }\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec x() -> fun((integer(), integer()) -> integer()). 12 11 x() -> 13 12 fun m:f/2. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__public_elixir.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 261 4 3 expression: "\n@external(erlang, \"Elixir.String\", \"main\")\npub fn do() -> Int\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec do() -> integer(). 12 11 do() -> 13 12 'Elixir.String':main(). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__public_local_function_calls.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 40 4 3 expression: "\n@external(erlang, \"m\", \"f\")\npub fn go(x x: Int, y y: Int) -> Int\nfn x() { go(x: 1, y: 2) go(y: 3, x: 4) }\n" 5 4 --- 6 5 -module(my@mod). ··· 16 15 x() -> 17 16 m:f(1, 2), 18 17 m:f(4, 3). 19 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__external_fn__unqualified_inlining_external_functions_from_another_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/external_fn.rs 3 - assertion_line: 84 4 3 expression: "import atom.{make}\npub fn main() {\n make(\"ok\")\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> binary(). 12 11 main() -> 13 12 erlang:binary_to_atom(<<"ok"/utf8>>). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__function_as_value.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 5 4 3 expression: "\nfn other() {\n Nil\n}\n\npub fn main() {\n other\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 -spec main() -> fun(() -> nil). 16 15 main() -> 17 16 fun other/0. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__function_called.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 62 4 3 expression: "\npub fn main() {\n main()\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> any(). 12 11 main() -> 13 12 main(). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__nested_aliased_imported_function_as_value.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 48 4 3 expression: "\nimport some/other.{wibble as wobble}\n\npub fn main() {\n wobble\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> fun(() -> nil). 12 11 main() -> 13 12 fun some@other:wibble/0. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__nested_aliased_imported_function_called.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 101 4 3 expression: "\nimport some/other.{wibble as wobble}\n\npub fn main() {\n wobble()\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> nil. 12 11 main() -> 13 12 some@other:wibble(). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__nested_imported_function_as_value.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 20 4 3 expression: "\nimport some/other\n\npub fn main() {\n other.wibble\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> fun(() -> nil). 12 11 main() -> 13 12 fun some@other:wibble/0. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__nested_imported_function_called.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 73 4 3 expression: "\nimport some/other\n\npub fn main() {\n other.wibble()\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> nil. 12 11 main() -> 13 12 some@other:wibble(). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__nested_unqualified_imported_function_as_value.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 34 4 3 expression: "\nimport some/other.{wibble}\n\npub fn main() {\n wibble\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> fun(() -> nil). 12 11 main() -> 13 12 fun some@other:wibble/0. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__functions__nested_unqualified_imported_function_called.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/functions.rs 3 - assertion_line: 87 4 3 expression: "\nimport some/other.{wibble}\n\npub fn main() {\n wibble()\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> nil. 12 11 main() -> 13 12 some@other:wibble(). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 6 4 3 expression: "\npub fn main(args) {\n case args {\n x if x == args -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards20.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 162 4 3 expression: "\npub fn main() {\n let x = 0.123\n case x {\n _ if 0.123 <. x -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards21.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 177 4 3 expression: "\npub fn main(x) {\n case x {\n _ if x == [1, 2, 3] -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards22.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 188 4 3 expression: "\npub fn main() {\n let x = 0\n case x {\n 0 -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards23.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 205 4 3 expression: "\npub fn main() {\n let x = #(1, 2, 3)\n case x {\n _ if x == #(1, 2, 3) -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards24.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 220 4 3 expression: "\npub fn main() {\n let x = #(1, 2, 3)\n case x {\n _ if x == #(1, 2, 3) -> 1\n _ if x == #(2, 3, 4) -> 2\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 21 20 _ -> 22 21 0 23 22 end. 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards25.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 241 4 3 expression: "\npub fn main() {\n let x = 0\n case x {\n _ if x == 0 -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards26.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 256 4 3 expression: "\npub fn main() {\n let x = 0\n case x {\n _ if 0 < x -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards27.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 273 4 3 expression: "\npub fn main() {\n case \"test\" {\n x if x == \"test\" -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards28.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 283 4 3 expression: "\n type Test { Test(x: Int, y: Float) }\n pub fn main() {\n let x = Test(1, 3.0)\n case x {\n _ if x == Test(1, 1.0) -> 1\n _ if x == Test(y: 2.0, x: 2) -> 2\n _ if x != Test(2, 3.0) -> 2\n _ -> 0\n }\n }\n" 5 4 --- 6 5 -module(my@mod). ··· 27 26 _ -> 28 27 0 29 28 end. 30 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards29.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 303 4 3 expression: "\npub fn main() {\n case 0.1, 1.0 {\n x, y if x <. y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards30.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 317 4 3 expression: "\npub fn main() {\n case 0.1, 1.0 {\n x, y if x <=. y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards31.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 331 4 3 expression: "\npub fn main(args) {\n case args {\n [x] | [x, _] if x -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 20 19 _ -> 21 20 0 22 21 end. 23 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 20 4 3 expression: "\npub fn main(args) {\n case args {\n x if {x != x} == {args == args} -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_10.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 147 4 3 expression: "\npub fn main() {\n let x = 0.123\n case x {\n _ if x == 3.14 -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 34 4 3 expression: "\npub fn main(args) {\n case args {\n x if x && x || x == x && x -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 48 4 3 expression: "\npub fn main() {\n case 1, 0 {\n x, y if x > y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_4.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 62 4 3 expression: "\npub fn main() {\n case 1, 0 {\n x, y if x >= y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_5.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 76 4 3 expression: "\npub fn main() {\n case 1, 0 {\n x, y if x < y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_6.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 90 4 3 expression: "\npub fn main() {\n case 1, 0 {\n x, y if x <= y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_7.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 104 4 3 expression: "\npub fn main() {\n case 1.0, 0.1 {\n x, y if x >. y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_8.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 118 4 3 expression: "\npub fn main() {\n case 1.0, 0.1 {\n x, y if x >=. y -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {_, _} -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__clause_guards_9.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 132 4 3 expression: "\npub fn main() {\n let x = 0.123\n case x {\n 99.9854 -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__constants_in_guards.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 345 4 3 expression: "\npub const string_value = \"constant value\"\npub const float_value = 3.14\npub const int_value = 42\npub const tuple_value = #(1, 2.0, \"3\")\npub const list_value = [1, 2, 3]\n\npub fn main(arg) {\n let _ = list_value\n case arg {\n #(w, x, y, z) if w == tuple_value && x == string_value && y >. float_value && z == int_value -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__constants_in_guards1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 366 4 3 expression: "\npub const list = [1, 2, 3]\n\npub fn main(arg) {\n case arg {\n _ if arg == list -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__field_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 446 4 3 expression: "\n pub type Person {\n Person(username: String, name: String, age: Int)\n }\n \n pub fn main() {\n let given_name = \"jack\"\n let raiden = Person(\"raiden\", \"jack\", 31)\n \n case given_name {\n name if name == raiden.name -> \"It's jack\"\n _ -> \"It's not jack\"\n }\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 22 21 _ -> 23 22 <<"It's not jack"/utf8>> 24 23 end. 25 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__module_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 562 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Tony Stark\"\n case name {\n n if n == hero.ironman.name -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 false 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__module_list_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 516 4 3 expression: "\n import hero\n pub fn main() {\n let names = [\"Tony Stark\", \"Bruce Wayne\"]\n case names {\n n if n == hero.heroes -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 false 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__module_nested_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 588 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Bruce Wayne\"\n case name {\n n if n == hero.batman.secret_identity.name -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 21 20 _ -> 22 21 false 23 22 end. 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__module_string_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 493 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Tony Stark\"\n case name {\n n if n == hero.ironman -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 false 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__module_tuple_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 539 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Tony Stark\"\n case name {\n n if n == hero.hero.1 -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 21 20 _ -> 22 21 false 23 22 end. 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__nested_record_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 467 4 3 expression: "\npub type A {\n A(b: B)\n}\n\npub type B {\n B(c: C)\n}\n\npub type C {\n C(d: Bool)\n}\n\npub fn a(a: A) {\n case a {\n _ if a.b.c.d -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 24 23 _ -> 25 24 0 26 25 end. 27 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__only_guards.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 382 4 3 expression: "\npub const string_value = \"constant value\"\n\npub fn main(arg) {\n case arg {\n _ if arg == string_value -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__only_guards1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 398 4 3 expression: "\npub const bits = <<1, \"ok\":utf8, 3, 4:50>>\n\npub fn main(arg) {\n case arg {\n _ if arg == bits -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__only_guards2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 414 4 3 expression: "\npub const constant = #(1, 2.0)\n\npub fn main(arg) {\n case arg {\n _ if arg == constant -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__guards__only_guards3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/guards.rs 3 - assertion_line: 430 4 3 expression: "\npub const float_value = 3.14\n\npub fn main(arg) {\n case arg {\n _ if arg >. float_value -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__let_assert__more_than_one_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/let_assert.rs 3 - assertion_line: 17 4 3 expression: "pub fn go(x) {\n let assert [1, a, b, c] = x\n [a, b, c]\n}" 5 4 --- 6 5 -module(my@mod). ··· 21 20 line => 2}) 22 21 end, 23 22 [A, B, C]. 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__let_assert__one_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/let_assert.rs 3 - assertion_line: 6 4 3 expression: "pub fn go() {\n let assert Ok(y) = Ok(1)\n y\n}" 5 4 --- 6 5 -module(my@mod). ··· 22 21 line => 2}) 23 22 end, 24 23 Y. 25 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__let_assert__pattern_let.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/let_assert.rs 3 - assertion_line: 28 4 3 expression: "pub fn go(x) {\n let assert [1 as a, b, c] = x\n [a, b, c]\n}" 5 4 --- 6 5 -module(my@mod). ··· 21 20 line => 2}) 22 21 end, 23 22 [A, B, C]. 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__let_assert__variable_rewrites.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/let_assert.rs 3 - assertion_line: 39 4 3 expression: "pub fn go() {\n let assert Ok(y) = Ok(1)\n let assert Ok(y) = Ok(1)\n y\n}" 5 4 --- 6 5 -module(my@mod). ··· 33 32 line => 3}) 34 33 end, 35 34 Y@1. 36 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__numbers__int_negation.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/numbers.rs 3 - assertion_line: 69 4 3 expression: "\npub fn main() {\n let a = 3\n let b = -a\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 main() -> 13 12 A = 3, 14 13 B = - A. 15 -
+1 -3
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__numbers__numbers_with_scientific_notation.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/numbers.rs 3 - assertion_line: 44 4 - expression: "\nconst i = 100.001e523\nconst j = -100.001e-523\n\nconst k = 100.001e1_230\nconst l = -100.001e-1_230\n\nconst m = 100.001e123_456_789\nconst n = -100.001e-123_456_789\n\npub fn main() {\n i\n j\n k\n l\n m\n n\n}\n" 3 + expression: "\nconst i = 100.001e523\nconst j = -100.001e-523\n\nconst k = 100.001e1_230\nconst l = -100.001e-1_230\n\nconst m = 100.001e123_456_789\nconst n = -100.001e-123_456_789\n\npub fn main() {\n i\n j\n k\n l\n m\n n\n}\n" 5 4 --- 6 5 -module(my@mod). 7 6 -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). ··· 16 15 -100.001e-1230, 17 16 100.001e123456789, 18 17 -100.001e-123456789. 19 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__numbers__numbers_with_underscores.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/numbers.rs 3 - assertion_line: 5 4 3 expression: "\npub fn main() {\n 100_000\n 100_000.00101\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 main() -> 13 12 100000, 14 13 100000.00101. 15 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__numbers__numbers_with_underscores1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/numbers.rs 3 - assertion_line: 17 4 3 expression: "\nconst i = 100_000\nconst f = 100_000.00101\npub fn main() {\n i\n f\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 main() -> 13 12 100000, 14 13 100000.00101. 15 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__numbers__numbers_with_underscores2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/numbers.rs 3 - assertion_line: 31 4 3 expression: "\npub fn main() {\n let assert 100_000 = 1\n let assert 100_000.00101 = 1.\n 1\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 33 32 line => 4}) 34 33 end, 35 34 1. 36 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__numbers__repeated_int_negation.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/numbers.rs 3 - assertion_line: 81 4 3 expression: "\npub fn main() {\n let a = 3\n let b = --a\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 main() -> 13 12 A = 3, 14 13 B = - - A. 15 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__numbers__zero_b_in_hex.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/numbers.rs 3 - assertion_line: 94 4 3 expression: "\npub fn main() {\n 0xffe0bb\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> integer(). 12 11 main() -> 13 12 16#ffe0bb. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__panic__panic_as.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/panic.rs 3 - assertion_line: 5 4 3 expression: "\npub fn main() {\n panic as \"wibble\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 module => <<"my/mod"/utf8>>, 16 15 function => <<"main"/utf8>>, 17 16 line => 3}). 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__panic__panic_as_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/panic.rs 3 - assertion_line: 27 4 3 expression: "\npub fn retstring() {\n \"wibble\"\n}\npub fn main() {\n panic as { retstring() <> \"wobble\" }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 19 18 module => <<"my/mod"/utf8>>, 20 19 function => <<"main"/utf8>>, 21 20 line => 6}). 22 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__panic__piped.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/panic.rs 3 - assertion_line: 42 4 3 expression: "\npub fn main() {\n \"lets\"\n |> panic\n}\n " 5 4 --- 6 5 -module(my@mod). ··· 16 15 module => <<"my/mod"/utf8>>, 17 16 function => <<"main"/utf8>>, 18 17 line => 4}))(_pipe). 19 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__panic__piped_chain.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/panic.rs 3 - assertion_line: 54 4 3 expression: "\n pub fn main() {\n \"lets\"\n |> panic as \"pipe\"\n |> panic as \"other panic\"\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 21 20 module => <<"my/mod"/utf8>>, 22 21 function => <<"main"/utf8>>, 23 22 line => 5}))(_pipe@1). 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__panic__plain.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/panic.rs 3 - assertion_line: 16 4 3 expression: "\npub fn main() {\n panic\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 module => <<"my/mod"/utf8>>, 16 15 function => <<"main"/utf8>>, 17 16 line => 3}). 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__patterns__alternative_patterns.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/patterns.rs 3 - assertion_line: 6 4 3 expression: "\npub fn main() {\n let duplicate_name = 1\n\n case 1 {\n 1 | 2 -> {\n let duplicate_name = duplicate_name + 1\n duplicate_name\n }\n _ -> 0\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 23 22 _ -> 24 23 0 25 24 end. 26 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__patterns__alternative_patterns1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/patterns.rs 3 - assertion_line: 25 4 3 expression: "\npub fn main() {\n case Ok(1) {\n Ok(duplicate_name) | Error(duplicate_name) -> duplicate_name\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {error, Duplicate_name} -> 18 17 Duplicate_name 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__patterns__alternative_patterns2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/patterns.rs 3 - assertion_line: 38 4 3 expression: "\npub fn main() {\n let duplicate_name = 1\n\n case 1 {\n 1 | 2 if duplicate_name == 1 -> duplicate_name\n _ -> 0\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 21 20 _ -> 22 21 0 23 22 end. 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__patterns__alternative_patterns3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/patterns.rs 3 - assertion_line: 53 4 3 expression: "\npub const constant = Ok(1)\n\npub fn main(arg) {\n let _ = constant\n case arg {\n _ if arg == constant -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 0 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__patterns__pattern_as.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/patterns.rs 3 - assertion_line: 70 4 3 expression: "pub fn a(x) {\n case x {\n Ok(1 as y) -> 1\n _ -> 0\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 0 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__block_expr_into_pipe.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 26 4 3 expression: "fn id(a) { a }\npub fn main() {\n {\n let x = 1\n x\n }\n |> id\n}" 5 4 --- 6 5 -module(my@mod). ··· 19 18 X 20 19 end, 21 20 id(_pipe). 22 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__call_pipeline_result.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 106 4 3 expression: "\npub fn main() {\n { 1 |> add }(1)\n}\n\npub fn add(x) {\n fn(y) { x + y }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _pipe = 1, 19 18 add(_pipe) 20 19 end(1). 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__clever_pipe_rewriting.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 6 4 3 expression: "\npub fn apply(f: fn(a) -> b, a: a) { a |> f }\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 apply(F, A) -> 13 12 _pipe = A, 14 13 F(_pipe). 15 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__clever_pipe_rewriting1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 16 4 3 expression: "\npub fn apply(f: fn(a, Int) -> b, a: a) { a |> f(1) }\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 apply(F, A) -> 13 12 _pipe = A, 14 13 F(_pipe, 1). 15 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__pipe_in_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 122 4 3 expression: "\npub fn main() {\n 123\n |> two(\n 1 |> two(2),\n _,\n )\n}\n\npub fn two(a, b) {\n a\n}\n" 5 4 --- 6 5 -module(my@mod).
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__pipe_in_case_subject.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 62 4 3 expression: "pub fn x(f) {\n case 1 |> f {\n x -> x\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 17 16 X -> 18 17 X 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__pipe_in_eq.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 92 4 3 expression: "fn id(x) {\n x\n}\n \npub fn main() {\n 1 == 1 |> id\n}" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _pipe = 1, 19 18 id(_pipe) 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__pipe_in_list.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 40 4 3 expression: "pub fn x(f) {\n [\n 1 |> f\n ]\n}" 5 4 --- 6 5 -module(my@mod). ··· 14 13 _pipe = 1, 15 14 F(_pipe) 16 15 end]. 17 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__pipe_in_spread.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 74 4 3 expression: "pub type X {\n X(a: Int, b: Int)\n}\n\nfn id(x) {\n x\n}\n \npub fn main(x) {\n X(..x, a: 1 |> id)\n}" 5 4 --- 6 5 -module(my@mod). ··· 25 24 id(_pipe) 26 25 end 27 26 ). 28 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__pipes__pipe_in_tuple.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/pipes.rs 3 - assertion_line: 51 4 3 expression: "pub fn x(f) {\n #(\n 1 |> f\n )\n}" 5 4 --- 6 5 -module(my@mod). ··· 14 13 _pipe = 1, 15 14 F(_pipe) 16 15 end}. 17 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__basic.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 7 4 3 expression: "record_definition(\"PetCat\",\n &[(\"name\", type_::tuple(vec![])), (\"is_cute\", type_::tuple(vec![]))])" 5 4 --- 6 5 -record(pet_cat, {name :: {}, is_cute :: {}}). 7 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__imported_qualified_constructor_as_fn_name_escape.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 357 4 3 expression: "import other_module\n\npub fn main() {\n other_module.Let\n}" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> fun((integer()) -> other_module:'let'()). 12 11 main() -> 13 12 fun(Field@0) -> {'let', Field@0} end. 14 -
+1 -3
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__long_definition_formatting.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 63 4 - expression: "record_definition(\"PetCat\",\n &[(\"name\", type_::generic_var(1)), (\"is_cute\", type_::unbound_var(1)),\n (\"linked\", type_::link(type_::int())),\n (\"whatever\",\n type_::list(type_::tuple(vec![type_ :: nil(), type_ ::\n list(type_ ::\n tuple(vec!\n [type_ :: nil(), type_ :: nil(), type_ :: nil()])), type_ ::\n nil(), type_ ::\n list(type_ ::\n tuple(vec!\n [type_ :: nil(), type_ :: nil(), type_ :: nil()])), type_ ::\n nil(), type_ ::\n list(type_ ::\n tuple(vec!\n [type_ :: nil(), type_ :: nil(), type_ :: nil()])),])))])" 3 + expression: "record_definition(\"PetCat\",\n &[(\"name\", type_::generic_var(1)), (\"is_cute\", type_::unbound_var(1)),\n (\"linked\", type_::link(type_::int())),\n (\"whatever\",\n type_::list(type_::tuple(vec![type_::nil(),\n type_::list(type_::tuple(vec![type_::nil(), type_::nil(),\n type_::nil()])), type_::nil(),\n type_::list(type_::tuple(vec![type_::nil(), type_::nil(),\n type_::nil()])), type_::nil(),\n type_::list(type_::tuple(vec![type_::nil(), type_::nil(),\n type_::nil()])),])))])" 5 4 --- 6 5 -record(pet_cat, { 7 6 name :: any(), ··· 14 13 nil, 15 14 list({nil, nil, nil})}) 16 15 }). 17 -
+1 -3
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__module_types.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 46 4 - expression: "record_definition(\"PetCat\",\n &[(\"name\",\n Arc::new(type_::Type::Named {\n public: true,\n module: module_name,\n name: \"my_type\".into(),\n args: vec![],\n }))])" 3 + expression: "record_definition(\"PetCat\",\n &[(\"name\",\n Arc::new(Type::Named {\n publicity: Publicity::Public,\n package: \"package\".into(),\n module: module_name,\n name: \"my_type\".into(),\n args: vec![],\n }))])" 5 4 --- 6 5 -record(pet_cat, {name :: name:my_type()}). 7 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__pipe_update_subject.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 323 4 3 expression: "pub type Thing {\n Thing(a: Int, b: Int)\n}\n\npub fn identity(x) { x }\n\npub fn main() {\n let thing = Thing(1, 2)\n Thing(..thing |> identity, b: 1000)\n}" 5 4 --- 6 5 -module(my@mod). ··· 26 25 end, 27 26 1000 28 27 ). 29 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_access_block.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 340 4 3 expression: "pub type Thing {\n Thing(a: Int, b: Int)\n}\n\npub fn main() {\n {\n let thing = Thing(1, 2)\n thing\n }.a\n}" 5 4 --- 6 5 -module(my@mod). ··· 20 19 Thing 21 20 end 22 21 ). 23 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_accessor_multiple_variants.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 99 4 3 expression: "\npub type Person {\n Teacher(name: String, title: String)\n Student(name: String, age: Int)\n}\npub fn get_name(person: Person) { person.name }" 5 4 --- 6 5 -module(my@mod). ··· 14 13 -spec get_name(person()) -> binary(). 15 14 get_name(Person) -> 16 15 erlang:element(2, Person). 17 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_accessor_multiple_variants_parameterised_types.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 128 4 3 expression: "\npub type Person {\n Teacher(name: String, age: List(Int), title: String)\n Student(name: String, age: List(Int))\n}\npub fn get_name(person: Person) { person.name }\npub fn get_age(person: Person) { person.age }" 5 4 --- 6 5 -module(my@mod). ··· 19 18 -spec get_age(person()) -> list(integer()). 20 19 get_age(Person) -> 21 20 erlang:element(3, Person). 22 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_accessor_multiple_variants_positions_other_than_first.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 113 4 3 expression: "\npub type Person {\n Teacher(name: String, age: Int, title: String)\n Student(name: String, age: Int)\n}\npub fn get_name(person: Person) { person.name }\npub fn get_age(person: Person) { person.age }" 5 4 --- 6 5 -module(my@mod). ··· 19 18 -spec get_age(person()) -> integer(). 20 19 get_age(Person) -> 21 20 erlang:element(3, Person). 22 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_accessor_multiple_with_first_position_different_types.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 143 4 3 expression: "\npub type Person {\n Teacher(name: Nil, age: Int)\n Student(name: String, age: Int)\n}\npub fn get_age(person: Person) { person.age }" 5 4 --- 6 5 -module(my@mod). ··· 14 13 -spec get_age(person()) -> integer(). 15 14 get_age(Person) -> 16 15 erlang:element(3, Person). 17 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_accessors.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 87 4 3 expression: "\npub type Person { Person(name: String, age: Int) }\npub fn get_age(person: Person) { person.age }\npub fn get_name(person: Person) { person.name }\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 -spec get_name(person()) -> binary(). 19 18 get_name(Person) -> 20 19 erlang:element(2, Person). 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_constants.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 313 4 3 expression: "pub type Test { A }\nconst some_test = A\npub fn a() { A }" 5 4 --- 6 5 -module(my@mod). ··· 14 13 -spec a() -> test(). 15 14 a() -> 16 15 a. 17 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_spread.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 156 4 3 expression: "\ntype Triple {\n Triple(a: Int, b: Int, c: Int)\n}\n\nfn main() {\n let triple = Triple(1,2,3)\n let Triple(the_a, ..) = triple\n the_a\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 Triple = {triple, 1, 2, 3}, 16 15 {triple, The_a, _, _} = Triple, 17 16 The_a. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_spread1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 175 4 3 expression: "\ntype Triple {\n Triple(a: Int, b: Int, c: Int)\n}\n\nfn main() {\n let triple = Triple(1,2,3)\n let Triple(b: the_b, ..) = triple\n the_b\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 Triple = {triple, 1, 2, 3}, 16 15 {triple, _, The_b, _} = Triple, 17 16 The_b. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_spread2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 193 4 3 expression: "\ntype Triple {\n Triple(a: Int, b: Int, c: Int)\n}\n\nfn main() {\n let triple = Triple(1,2,3)\n let Triple(the_a, c: the_c, ..) = triple\n the_c\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 Triple = {triple, 1, 2, 3}, 16 15 {triple, The_a, _, The_c} = Triple, 17 16 The_c. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_spread3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 211 4 3 expression: "\ntype Triple {\n Triple(a: Int, b: Int, c: Int)\n}\n\nfn main() {\n let triple = Triple(1,2,3)\n case triple {\n Triple(b: the_b, ..) -> the_b\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 {triple, _, The_b, _} -> 18 17 The_b 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_updates.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 230 4 3 expression: "\npub type Person { Person(name: String, age: Int) }\n\nfn main() {\n let p = Person(\"Quinn\", 27)\n let new_p = Person(..p, age: 28)\n new_p\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 P = {person, <<"Quinn"/utf8>>, 27}, 16 15 New_p = erlang:setelement(3, P, 28), 17 16 New_p. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_updates1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 246 4 3 expression: "\npub type Person { Person(name: String, age: Int) }\n\nfn main() {\n let p = Person(\"Quinn\", 27)\n let new_p = Person(..p, age: p.age + 1)\n new_p\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 P = {person, <<"Quinn"/utf8>>, 27}, 16 15 New_p = erlang:setelement(3, P, erlang:element(3, P) + 1), 17 16 New_p. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_updates2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 262 4 3 expression: "\npub type Person { Person(name: String, age: Int) }\n\nfn main() {\n let p = Person(\"Quinn\", 27)\n let new_p = Person(..p, age: 28, name: \"Riley\")\n new_p\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 P = {person, <<"Quinn"/utf8>>, 27}, 16 15 New_p = erlang:setelement(2, erlang:setelement(3, P, 28), <<"Riley"/utf8>>), 17 16 New_p. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_updates3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 278 4 3 expression: "\npub type Person { Person(name: String, age: Int) }\n\nfn main() {\n let new_p = Person(..return_person(), age: 28)\n new_p\n}\n\nfn return_person() {\n Person(\"Quinn\", 27)\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 main() -> 19 18 New_p = erlang:setelement(3, return_person(), 28), 20 19 New_p. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__record_updates4.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 297 4 3 expression: "\npub type Car { Car(make: String, model: String, driver: Person) }\npub type Person { Person(name: String, age: Int) }\n\nfn main() {\n let car = Car(make: \"Amphicar\", model: \"Model 770\", driver: Person(name: \"John Doe\", age: 27))\n let new_p = Person(..car.driver, age: 28)\n new_p\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 20 19 {person, <<"John Doe"/utf8>>, 27}}, 21 20 New_p = erlang:setelement(3, erlang:element(4, Car), 28), 22 21 New_p. 23 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__reserve_words.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 19 4 3 expression: "record_definition(\"div\",\n &[(\"receive\", type_::int()), (\"catch\", type_::tuple(vec![])),\n (\"unreserved\", type_::tuple(vec![]))])" 5 4 --- 6 5 -record('div', {'receive' :: integer(), 'catch' :: {}, unreserved :: {}}). 7 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__records__type_vars.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/records.rs 3 - assertion_line: 32 4 3 expression: "record_definition(\"PetCat\",\n &[(\"name\", type_::generic_var(1)), (\"is_cute\", type_::unbound_var(1)),\n (\"linked\", type_::link(type_::int()))])" 5 4 --- 6 5 -record(pet_cat, {name :: any(), is_cute :: any(), linked :: integer()}). 7 -
-4
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__reserved__build_in_erlang_type_escaping.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/reserved.rs 3 - assertion_line: 5 4 3 expression: pub type Map 5 4 --- 6 5 -module(my@mod). ··· 9 8 -export_type([map_/0]). 10 9 11 10 -type map_() :: any(). 12 - 13 - 14 -
-4
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__reserved__escape_erlang_reserved_keywords_in_type_names.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/reserved.rs 3 - assertion_line: 12 4 3 expression: "pub type After { TestAfter }\npub type And { TestAnd }\npub type Andalso { TestAndAlso }\npub type Band { TestBAnd }\npub type Begin { TestBegin }\npub type Bnot { TestBNot }\npub type Bor { TestBOr }\npub type Bsl { TestBsl }\npub type Bsr { TestBsr }\npub type Bxor { TestBXor }\npub type Case { TestCase }\npub type Catch { TestCatch }\npub type Cond { TestCond }\npub type Div { TestDiv }\npub type End { TestEnd }\npub type Fun { TestFun }\npub type If { TestIf }\npub type Let { TestLet }\npub type Not { TestNot }\npub type Of { TestOf }\npub type Or { TestOr }\npub type Orelse { TestOrElse }\npub type Query { TestQuery }\npub type Receive { TestReceive }\npub type Rem { TestRem }\npub type Try { TestTry }\npub type When { TestWhen }\npub type Xor { TestXor }" 5 4 --- 6 5 -module(my@mod). ··· 63 62 -type 'when'() :: test_when. 64 63 65 64 -type 'xor'() :: test_xor. 66 - 67 - 68 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__ascii_as_unicode_escape_sequence.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 106 4 3 expression: "\npub fn y() -> String {\n \"\\u{79}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec y() -> binary(). 12 11 y() -> 13 12 <<"\x{79}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__assert_string_prefix.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 284 4 3 expression: "\npub fn main(x) {\n let assert \"m-\" <> rest = x\n rest\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 21 20 line => 3}) 22 21 end, 23 22 Rest. 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__assert_string_prefix_discar.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 296 4 3 expression: "\npub fn main(x) {\n let assert \"m-\" <> _ = x\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 20 19 function => <<"main"/utf8>>, 21 20 line => 3}) 22 21 end. 23 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__concat.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 117 4 3 expression: "\npub fn go(x, y) {\n x <> y\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec go(binary(), binary()) -> binary(). 12 11 go(X, Y) -> 13 12 <<X/binary, Y/binary>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__concat_3_variables.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 128 4 3 expression: "\npub fn go(x, y, z) {\n x <> y <> z\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec go(binary(), binary(), binary()) -> binary(). 12 11 go(X, Y, Z) -> 13 12 <<<<X/binary, Y/binary>>/binary, Z/binary>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__concat_constant.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 238 4 3 expression: "\nconst a = \"Hello, \"\nconst b = \"Joe!\"\n\npub fn go() {\n a <> b\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec go() -> binary(). 12 11 go() -> 13 12 <<"Hello, "/utf8, "Joe!"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__concat_constant_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 252 4 3 expression: "\nconst cs = s\n\nfn s() {\n \"s\"\n}\n\npub fn go() {\n cs() <> cs()\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 -spec go() -> binary(). 16 15 go() -> 17 16 <<(s())/binary, (s())/binary>>. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__concat_function_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 223 4 3 expression: "\nfn x() {\n \"\"\n}\n\npub fn go() {\n x() <> x()\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 -spec go() -> binary(). 16 15 go() -> 17 16 <<(x())/binary, (x())/binary>>. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__discard_concat_rest_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 198 4 3 expression: "\npub fn go(x) {\n case x {\n \"Hello, \" <> _ -> Nil\n _ -> Nil\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 nil 19 18 end. 20 -
-14
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__escape_u_1.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 274 4 - expression: "\npub fn main() {\n \"\\u{1f600}\"\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). 8 - 9 - -export([main/0]). 10 - 11 - -spec main() -> binary(). 12 - main() -> 13 - <<"\x{1f600}"/utf8>>. 14 -
-14
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__escape_u_2.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 285 4 - expression: "\npub fn main() {\n \"Hello \\u{1f600}\"\n}\n" 5 - --- 6 - -module(my@mod). 7 - -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). 8 - 9 - -export([main/0]). 10 - 11 - -spec main() -> binary(). 12 - main() -> 13 - <<"Hello \x{1f600}"/utf8>>. 14 -
-13
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__not_unicode.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/strings.rs 3 - expression: "\npub fn not_unicode_escape_sequence() -> String {\n \"\\\\u{03a9}\"\n}\n" 4 - --- 5 - -module(my@mod). 6 - -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). 7 - 8 - -export([not_unicode_escape_sequence/0]). 9 - 10 - -spec not_unicode_escape_sequence() -> binary(). 11 - not_unicode_escape_sequence() -> 12 - <<"\\u{03a9}"/utf8>>. 13 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__not_unicode_escape_sequence.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 62 4 3 expression: "\npub fn not_unicode_escape_sequence() -> String {\n \"\\\\u{03a9}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec not_unicode_escape_sequence() -> binary(). 12 11 not_unicode_escape_sequence() -> 13 12 <<"\\u{03a9}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__not_unicode_escape_sequence2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 73 4 3 expression: "\npub fn not_unicode_escape_sequence() -> String {\n \"\\\\\\\\u{03a9}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec not_unicode_escape_sequence() -> binary(). 12 11 not_unicode_escape_sequence() -> 13 12 <<"\\\\u{03a9}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__pipe_concat.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 269 4 3 expression: "\nfn id(x) {\n x\n}\n\npub fn main() {\n { \"\" |> id } <> { \"\" |> id }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 22 21 _pipe@1 = <<""/utf8>>, 23 22 id(_pipe@1) 24 23 end)/binary>>. 25 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__rest_variable_rewriting.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 183 4 3 expression: "\npub fn go(x) {\n case x {\n \"Hello, \" <> x -> x\n _ -> \"Unknown\"\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 <<"Unknown"/utf8>> 19 18 end. 20 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__string_of_number_concat.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 212 4 3 expression: "\npub fn go(x) {\n x <> \"1\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec go(binary()) -> binary(). 12 11 go(X) -> 13 12 <<X/binary, "1"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__string_prefix.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 139 4 3 expression: "\npub fn go(x) {\n case x {\n \"Hello, \" <> name -> name\n _ -> \"Unknown\"\n }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 17 16 _ -> 18 17 <<"Unknown"/utf8>> 19 18 end. 20 -
-13
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode.snap
··· 1 - --- 2 - source: compiler-core/src/erlang/tests/strings.rs 3 - expression: "\npub fn emoji() -> String {\n \"\\u{0001f600}\"\n}\n" 4 - --- 5 - -module(my@mod). 6 - -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). 7 - 8 - -export([emoji/0]). 9 - 10 - -spec emoji() -> binary(). 11 - emoji() -> 12 - <<(erlang:binary_to_integer(<<"0001f600">>, 16))/utf8>>. 13 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 5 4 3 expression: "\npub fn emoji() -> String {\n \"\\u{1f600}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec emoji() -> binary(). 12 11 emoji() -> 13 12 <<"\x{1f600}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 16 4 3 expression: "\npub fn y_with_dieresis() -> String {\n \"\\u{0308}y\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec y_with_dieresis() -> binary(). 12 11 y_with_dieresis() -> 13 12 <<"\x{0308}y"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 84 4 3 expression: "\npub fn y_with_dieresis_with_slash() -> String {\n \"\\\\\\u{0308}y\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec y_with_dieresis_with_slash() -> binary(). 12 11 y_with_dieresis_with_slash() -> 13 12 <<"\\\x{0308}y"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode_concat1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 27 4 3 expression: "\npub fn main(x) -> String {\n x <> \"\\u{0308}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main(binary()) -> binary(). 12 11 main(X) -> 13 12 <<X/binary, "\x{0308}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode_concat2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 38 4 3 expression: "\npub fn main(x) -> String {\n x <> \"\\\\u{0308}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main(binary()) -> binary(). 12 11 main(X) -> 13 12 <<X/binary, "\\u{0308}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode_concat3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 49 4 3 expression: "\npub fn main(x) -> String {\n x <> \"\\\\\\u{0308}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main(binary()) -> binary(). 12 11 main(X) -> 13 12 <<X/binary, "\\\x{0308}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__strings__unicode_escape_sequence_6_digits.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/strings.rs 3 - assertion_line: 95 4 3 expression: "\npub fn unicode_escape_sequence_6_digits() -> String {\n \"\\u{10abcd}\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec unicode_escape_sequence_6_digits() -> binary(). 12 11 unicode_escape_sequence_6_digits() -> 13 12 <<"\x{10abcd}"/utf8>>. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__todo__named.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/todo.rs 3 - assertion_line: 27 4 3 expression: "\npub fn main() {\n todo as \"testing\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 module => <<"my/mod"/utf8>>, 16 15 function => <<"main"/utf8>>, 17 16 line => 3}). 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__todo__piped.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/todo.rs 3 - assertion_line: 52 4 3 expression: "\n pub fn main() {\n \"lets\"\n |> todo as \"pipe\"\n |> todo as \"other todo\"\n }\n " 5 4 --- 6 5 -module(my@mod). ··· 21 20 module => <<"my/mod"/utf8>>, 22 21 function => <<"main"/utf8>>, 23 22 line => 5}))(_pipe@1). 24 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__todo__plain.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/todo.rs 3 - assertion_line: 5 4 3 expression: "\npub fn main() {\n todo\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 module => <<"my/mod"/utf8>>, 16 15 function => <<"main"/utf8>>, 17 16 line => 3}). 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__todo__todo_as.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/todo.rs 3 - assertion_line: 16 4 3 expression: "\npub fn main() {\n todo as \"wibble\"\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 module => <<"my/mod"/utf8>>, 16 15 function => <<"main"/utf8>>, 17 16 line => 3}). 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__todo__todo_as_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/todo.rs 3 - assertion_line: 38 4 3 expression: "\npub fn retstring() {\n \"wibble\"\n}\npub fn main() {\n todo as { retstring() <> \"wobble\" }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 19 18 module => <<"my/mod"/utf8>>, 20 19 function => <<"main"/utf8>>, 21 20 line => 6}). 22 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__use___arity_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/use_.rs 3 - assertion_line: 5 4 3 expression: "\npub fn main() {\n use <- pair()\n 123\n}\n\nfn pair(f) {\n let x = f()\n #(x, x)\n}\n" 5 4 --- 6 5 -module(my@mod).
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__use___arity_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/use_.rs 3 - assertion_line: 22 4 3 expression: "\npub fn main() {\n use <- pair(1.0)\n 123\n}\n\nfn pair(x, f) {\n let y = f()\n #(x, y)\n}\n" 5 4 --- 6 5 -module(my@mod).
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__use___arity_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/use_.rs 3 - assertion_line: 39 4 3 expression: "\npub fn main() {\n use <- trip(1.0, \"\")\n 123\n}\n\nfn trip(x, y, f) {\n let z = f()\n #(x, y, z)\n}\n" 5 4 --- 6 5 -module(my@mod).
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__use___no_callback_body.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/use_.rs 3 - assertion_line: 56 4 3 expression: "\npub fn main() {\n let thingy = fn(f) { f() }\n use <- thingy()\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 16 15 module => <<"my/mod"/utf8>>, 17 16 function => <<"main"/utf8>>, 18 17 line => 4}) end). 19 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__use___pipeline_that_returns_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/use_.rs 3 - assertion_line: 69 4 3 expression: "\npub fn main() {\n use <- 1 |> add\n 1\n}\n\npub fn add(x) {\n fn(f) { f() + x }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _pipe = 1, 19 18 add(_pipe) 20 19 end(fun() -> 1 end). 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__anon_external_fun_name_escaping.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/variables.rs 3 - assertion_line: 70 4 3 expression: "\n@external(erlang, \"one.two\", \"three.four\")\nfn func() -> Nil\n\npub fn main() {\n func\n}" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main() -> fun(() -> nil). 12 11 main() -> 13 12 fun 'one.two':'three.four'/0. 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__blocks_are_scopes.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/variables.rs 3 - assertion_line: 100 4 3 expression: "\npub fn main() {\n let x = 1\n {\n let x = 2\n }\n x\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 15 14 X@1 = 2 16 15 end, 17 16 X. 18 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__discarded.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/variables.rs 3 - assertion_line: 58 4 3 expression: "pub fn go() {\n let _r = 1\n let _r = 2\n Nil\n}" 5 4 --- 6 5 -module(my@mod). ··· 13 12 _ = 1, 14 13 _ = 2, 15 14 nil. 16 -
-1
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__module_const_vars.snap
··· 24 24 (erlang:element(2, {42, fun int_identity/1, fun int_identity/1}))( 25 25 erlang:element(1, {42, fun int_identity/1, fun int_identity/1}) 26 26 ). 27 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__shadow_and_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/variables.rs 3 - assertion_line: 34 4 3 expression: "\npub fn main(x) {\n fn(x) { x }(x)\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 11 10 -spec main(I) -> I. 12 11 main(X) -> 13 12 (fun(X@1) -> X@1 end)(X). 14 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__shadow_let.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/variables.rs 3 - assertion_line: 6 4 3 expression: "\npub fn go(a) {\n case a {\n 99 -> {\n let a = a\n 1\n }\n _ -> a\n }\n}" 5 4 --- 6 5 -module(my@mod). ··· 18 17 _ -> 19 18 A 20 19 end. 21 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__shadow_param.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/variables.rs 3 - assertion_line: 23 4 3 expression: "pub fn main(board) {\nfn(board) { board }\n board\n}" 5 4 --- 6 5 -module(my@mod). ··· 12 11 main(Board) -> 13 12 fun(Board@1) -> Board@1 end, 14 13 Board. 15 -
-2
compiler-core/src/erlang/tests/snapshots/gleam_core__erlang__tests__variables__shadow_pipe.snap
··· 1 1 --- 2 2 source: compiler-core/src/erlang/tests/variables.rs 3 - assertion_line: 45 4 3 expression: "\npub fn main(x) {\n x\n |> fn(x) { x }\n}\n" 5 4 --- 6 5 -module(my@mod). ··· 12 11 main(X) -> 13 12 _pipe = X, 14 13 (fun(X@1) -> X@1 end)(_pipe). 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__assert.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 16 4 3 expression: "fn go(x) { let assert 1 = x }" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 18 17 } 19 18 return x; 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__assert1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 21 4 3 expression: "fn go(x) { let assert #(1, 2) = x }" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 18 17 } 19 18 return x; 20 19 } 21 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__constant_assignments.snap
··· 14 14 let a$1 = 10; 15 15 return a$1 + 20; 16 16 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__correct_variable_renaming_in_assigned_functions.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 141 4 3 expression: "\npub fn debug(x) {\n let x = x\n fn(x) { x + 1 }\n}\n" 5 4 --- 6 5 export function debug(x) { 7 6 let x$1 = x; 8 7 return (x) => { return x + 1; }; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__let_assert_string_prefix.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 179 4 3 expression: "\npub fn main() {\n let assert \"Game \" <> id = \"Game 1\"\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 20 19 let id = $.slice(5); 21 20 return $; 22 21 } 23 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__module_const_var.snap
··· 15 15 export function use_compound() { 16 16 return compound[0] + compound[1]; 17 17 } 18 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__module_const_var1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 167 4 3 expression: "\npub const int = 42\npub const int_alias = int \npub const compound: #(Int, Int) = #(int, int_alias)\n" 5 4 --- 6 5 export const int: number; ··· 8 7 export const int_alias: number; 9 8 10 9 export const compound: [number, number]; 11 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__nested_binding.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 26 4 - expression: "\nfn go(x) {\n let #(a, #(b, c, 2) as t, _, 1) = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert #(a, #(b, c, 2) as t, _, 1) = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 22 21 let c = x[1][1]; 23 22 return x; 24 23 } 25 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__rebound_argument.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 88 4 3 expression: "pub fn main(x) {\n let x = False\n x\n}\n" 5 4 --- 6 5 export function main(x) { 7 6 let x$1 = false; 8 7 return x$1; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__rebound_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 99 4 3 expression: "pub fn x() { \n Nil\n}\n \npub fn main() {\n let x = False\n x\n}\n" 5 4 --- 6 5 export function x() { ··· 11 10 let x$1 = false; 12 11 return x$1; 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__rebound_function_and_arg.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 114 4 3 expression: "pub fn x() { \n Nil\n}\n \npub fn main(x) {\n let x = False\n x\n}\n" 5 4 --- 6 5 export function x() { ··· 11 10 let x$1 = false; 12 11 return x$1; 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__returning_literal_subject.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 83 4 3 expression: "fn go(x) { let assert 1 = x + 1 }" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 19 18 } 20 19 return $; 21 20 } 22 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__tuple_matching.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 5 4 - expression: "\nfn go(x) {\n let #(1, 2) = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert #(1, 2) = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 18 17 } 19 18 return x; 20 19 } 21 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__variable_renaming.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 37 4 - expression: "\n\nfn go(x, foo) {\n let a = 1\n foo(a)\n let a = 2\n foo(a)\n let #(a, 3) = x\n let b = a\n foo(b)\n let c = {\n let a = a\n #(a, b)\n }\n foo(a)\n // make sure arguments are counted in initial state\n let x = c\n x\n}\n" 3 + expression: "\n\nfn go(x, foo) {\n let a = 1\n foo(a)\n let a = 2\n foo(a)\n let assert #(a, 3) = x\n let b = a\n foo(b)\n let c = {\n let a = a\n #(a, b)\n }\n foo(a)\n // make sure arguments are counted in initial state\n let x = c\n x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 31 30 let x$1 = c; 32 31 return x$1; 33 32 } 34 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__assignments__variable_used_in_pattern_and_assignment.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/assignments.rs 3 - assertion_line: 129 4 3 expression: "pub fn main(x) {\n let #(x) = #(x)\n x\n}\n" 5 4 --- 6 5 export function main(x) { ··· 8 7 let x$1 = $[0]; 9 8 return x$1; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__as_module_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 281 4 3 expression: "\n pub const data = <<\n 0x1,\n 2,\n 2:size(16),\n 0x4:size(32),\n \"Gleam\":utf8,\n 4.2:float,\n <<\n <<1, 2, 3>>:bits,\n \"Gleam\":utf8,\n 1024\n >>:bits\n >>\n " 5 4 --- 6 5 import { toBitArray, sizedInt, stringBits, float64Bits } from "../gleam.mjs"; ··· 14 13 float64Bits(4.2), 15 14 toBitArray([toBitArray([1, 2, 3]).buffer, stringBits("Gleam"), 1024]).buffer, 16 15 ]); 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__bit_string.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 137 4 3 expression: "\nfn go(x) {\n <<x:bits>>\n}\n" 5 4 --- 6 5 import { toBitArray } from "../gleam.mjs"; ··· 8 7 function go(x) { 9 8 return toBitArray([x.buffer]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__bit_string_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 159 4 3 expression: "\npub fn go(x) {\n <<x:bits>>\n}\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; 7 6 8 7 export function go(x: _.BitArray): _.BitArray; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__bits.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 148 4 3 expression: "\nfn go(x) {\n <<x:bits>>\n}\n" 5 4 --- 6 5 import { toBitArray } from "../gleam.mjs"; ··· 8 7 function go(x) { 9 8 return toBitArray([x.buffer]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__bits_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 170 4 3 expression: "\npub fn go(x) {\n <<x:bits>>\n}\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; 7 6 8 7 export function go(x: _.BitArray): _.BitArray; 9 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__discard_sized.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 214 4 - expression: "\nfn go(x) {\n let <<_:16, _:8>> = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert <<_:16, _:8>> = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 18 17 } 19 18 return x; 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__empty.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 5 4 3 expression: "\nfn go() {\n <<>>\n}\n" 5 4 --- 6 5 import { toBitArray } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return toBitArray([]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__empty_match.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 181 4 3 expression: "\nfn go(x) {\n let assert <<>> = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 18 17 } 19 18 return x; 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__explicit_sized.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 71 4 3 expression: "\nfn go() {\n <<256:size(4)>>\n}\n" 5 4 --- 6 5 import { toBitArray, sizedInt } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return toBitArray([sizedInt(256, 4)]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__float.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 49 4 3 expression: "\nfn go() {\n <<1.1:float>>\n}\n" 5 4 --- 6 5 import { toBitArray, float64Bits } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return toBitArray([float64Bits(1.1)]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__integer.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 38 4 3 expression: "\nfn go() {\n <<256:int>>\n}\n" 5 4 --- 6 5 import { toBitArray } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return toBitArray([256]); 10 9 } 11 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__match_binary_size.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 269 4 - expression: "\nfn go(x) {\n let <<_, a:2-binary>> = x\n let <<_, b:binary-size(2)>> = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert <<_, a:2-bytes>> = x\n let assert <<_, b:bytes-size(2)>> = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 30 29 let b = x.binaryFromSlice(1, 3); 31 30 return x; 32 31 } 33 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__match_bytes.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 192 4 3 expression: "\nfn go(x) {\n let assert <<1, y>> = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 19 18 let y = x.byteAt(1); 20 19 return x; 21 20 } 22 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__match_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 236 4 - expression: "\nfn go(x) {\n let <<a:float, b:int>> = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert <<a:float, b:int>> = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 20 19 let b = x.byteAt(8); 21 20 return x; 22 21 } 23 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__match_rest.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 247 4 - expression: "\nfn go(x) {\n let <<_, b:bytes>> = <<1,2,3>>\n}\n" 3 + expression: "\nfn go(x) {\n let assert <<_, b:bytes>> = <<1,2,3>>\n}\n" 5 4 --- 6 5 import { makeError, toBitArray } from "../gleam.mjs"; 7 6 ··· 20 19 let b = $.sliceAfter(1); 21 20 return $; 22 21 } 23 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__match_rest_deprecated.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 258 4 - expression: "\nfn go(x) {\n let <<_, b:binary>> = <<1,2,3>>\n}\n" 3 + expression: "\nfn go(x) {\n let assert <<_, b:bytes>> = <<1,2,3>>\n}\n" 5 4 --- 6 5 import { makeError, toBitArray } from "../gleam.mjs"; 7 6 ··· 20 19 let b = $.sliceAfter(1); 21 20 return $; 22 21 } 23 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__match_sized.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 203 4 - expression: "\nfn go(x) {\n let <<a:16, b:8>> = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert <<a:16, b:8>> = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 20 19 let b = x.intFromSlice(2, 3); 21 20 return x; 22 21 } 23 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__one.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 16 4 3 expression: "\nfn go() {\n <<256>>\n}\n" 5 4 --- 6 5 import { toBitArray } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return toBitArray([256]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__sized.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 60 4 3 expression: "\nfn go() {\n <<256:4>>\n}\n" 5 4 --- 6 5 import { toBitArray, sizedInt } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return toBitArray([sizedInt(256, 4)]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__two.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 27 4 3 expression: "\nfn go() {\n <<256, 4>>\n}\n" 5 4 --- 6 5 import { toBitArray } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return toBitArray([256, 4]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__utf8.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 104 4 3 expression: "\nfn go(x) {\n <<256, 4, x, \"Gleam\":utf8>>\n}\n" 5 4 --- 6 5 import { toBitArray, stringBits } from "../gleam.mjs"; ··· 8 7 function go(x) { 9 8 return toBitArray([256, 4, x, stringBits("Gleam")]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__utf8_codepoint.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 115 4 3 expression: "\nfn go(x) {\n <<x:utf8_codepoint, \"Gleam\":utf8>>\n}\n" 5 4 --- 6 5 import { toBitArray, stringBits, codepointBits } from "../gleam.mjs"; ··· 8 7 function go(x) { 9 8 return toBitArray([codepointBits(x), stringBits("Gleam")]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__utf8_codepoint_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 126 4 3 expression: "\npub fn go(x) {\n <<x:utf8_codepoint, \"Gleam\":utf8>>\n}\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; 7 6 8 7 export function go(x: _.UtfCodepoint): _.BitArray; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__variable.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 93 4 3 expression: "\nfn go(x) {\n <<256, 4, x>>\n}\n" 5 4 --- 6 5 import { toBitArray } from "../gleam.mjs"; ··· 8 7 function go(x) { 9 8 return toBitArray([256, 4, x]); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_arrays__variable_sized.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bit_arrays.rs 3 - assertion_line: 82 4 3 expression: "\nfn go(x, y) {\n <<x:size(y)>>\n}\n" 5 4 --- 6 5 import { toBitArray, sizedInt } from "../gleam.mjs"; ··· 8 7 function go(x, y) { 9 8 return toBitArray([sizedInt(x, y)]); 10 9 } 11 -
-17
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bit_strings__as_module_const.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/bit_strings.rs 3 - assertion_line: 248 4 - expression: "\n pub const data = <<\n 0x1,\n 2,\n 2:size(16),\n 0x4:size(32),\n \"Gleam\":utf8,\n 4.2:float,\n <<\n <<1, 2, 3>>:bits,\n \"Gleam\":utf8,\n 1024\n >>:bits\n >>\n " 5 - --- 6 - import { toBitString, sizedInt, stringBits, float64Bits } from "../gleam.mjs"; 7 - 8 - export const data = toBitString([ 9 - 0x1, 10 - 2, 11 - sizedInt(2, 16), 12 - sizedInt(0x4, 32), 13 - stringBits("Gleam"), 14 - float64Bits(4.2), 15 - toBitString([toBitString([1, 2, 3]).buffer, stringBits("Gleam"), 1024]).buffer, 16 - ]); 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__blocks__block.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/blocks.rs 3 - assertion_line: 5 4 3 expression: "\nfn go() {\n let x = {\n 1\n 2\n }\n x\n}\n" 5 4 --- 6 5 function go() { ··· 10 9 })(); 11 10 return x; 12 11 } 13 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__blocks__block_with_parenthesised_expression_returning_from_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/blocks.rs 3 - assertion_line: 208 4 3 expression: "\nfn b() {\n {\n 1 + 2\n }\n}\n" 5 4 --- 6 5 function b() {
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__blocks__concat_blocks.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/blocks.rs 3 - assertion_line: 61 4 3 expression: "\nfn main(f, a, b) {\n {\n a\n |> f\n } <> {\n b\n |> f\n }\n}\n" 5 4 --- 6 5 function main(f, a, b) { ··· 12 11 return f(_pipe); 13 12 })(); 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__blocks__left_operator_sequence.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/blocks.rs 3 - assertion_line: 33 4 3 expression: "\nfn go() {\n 1 == {\n 1\n 2\n }\n}\n" 5 4 --- 6 5 function go() { ··· 9 8 return 2; 10 9 })(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__blocks__right_operator_sequence.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/blocks.rs 3 - assertion_line: 47 4 3 expression: "\nfn go() {\n {\n 1\n 2\n } == 1\n}\n" 5 4 --- 6 5 function go() { ··· 9 8 return 2; 10 9 })() === 1; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__blocks__sequences.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/blocks.rs 3 - assertion_line: 20 4 3 expression: "\nfn go() {\n \"one\"\n \"two\"\n \"three\"\n}\n" 5 4 --- 6 5 function go() { ··· 8 7 "two"; 9 8 return "three"; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__assigning.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 52 4 3 expression: "\nfn go(x, y) {\n let assert True = x\n let assert False = x\n let assert Nil = y\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 38 37 } 39 38 return y; 40 39 } 41 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__binop_todo_left.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 189 4 3 expression: "pub fn negate(x) {\n todo && x\n}" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 17 16 ) 18 17 })() && x; 19 18 } 20 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__binop_todo_right.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 180 4 3 expression: "pub fn negate(x) {\n x && todo\n}" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 17 16 ) 18 17 })(); 19 18 } 20 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__case.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 114 4 3 expression: "\nfn go(a) {\n case a {\n True -> 1\n False -> 0\n }\n}\n" 5 4 --- 6 5 function go(a) { ··· 10 9 return 0; 11 10 } 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__constants.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 18 4 3 expression: "\nconst a = True\nconst b = False\nconst c = Nil\n" 5 4 --- 6 5 const a = true; ··· 8 7 const b = false; 9 8 10 9 const c = undefined; 11 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__constants_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 29 4 3 expression: "\npub const a = True\npub const b = False\npub const c = Nil\n" 5 4 --- 6 5 export const a: boolean;
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__equality.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 95 4 3 expression: "\nfn go(a, b) {\n a == True\n a != True\n a == False\n a != False\n a == a\n a != a\n b == Nil\n b != Nil\n b == b\n}\n" 5 4 --- 6 5 function go(a, b) { ··· 14 13 b !== undefined; 15 14 return b === b; 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__expressions.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 5 4 3 expression: "\nfn go() {\n True\n False\n Nil\n}\n" 5 4 --- 6 5 function go() { ··· 8 7 false; 9 8 return undefined; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__negate_todo.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 207 4 3 expression: "pub fn negate(x) {\n !todo\n}" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 17 16 ) 18 17 })(); 19 18 } 20 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__negation.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 141 4 3 expression: "pub fn negate(x) {\n !x\n}" 5 4 --- 6 5 export function negate(x) { 7 6 return !x; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__negation_block.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 150 4 3 expression: "pub fn negate(x) {\n !{\n 123\n x\n }\n}" 5 4 --- 6 5 export function negate(x) { ··· 9 8 return x; 10 9 })(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__nil_case.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 128 4 3 expression: "\nfn go(a) {\n case a {\n Nil -> 0\n }\n}\n" 5 4 --- 6 5 function go(a) { 7 6 return 0; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__operators.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 40 4 3 expression: "\nfn go() {\n True && True\n False || False\n}\n" 5 4 --- 6 5 function go() { 7 6 true && true; 8 7 return false || false; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__shadowed_bools_and_nil.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 67 4 3 expression: "\npub type True { True False Nil }\nfn go(x, y) {\n let assert True = x\n let assert False = x\n let assert Nil = y\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType, makeError } from "../gleam.mjs"; ··· 44 43 } 45 44 return y; 46 45 } 47 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__bools__shadowed_bools_and_nil_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/bools.rs 3 - assertion_line: 81 4 3 expression: "\npub type True { True False Nil }\npub fn go(x, y) {\n let assert True = x\n let assert False = x\n let assert Nil = y\n}\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 14 13 export type True$ = True | False | Nil; 15 14 16 15 export function go(x: True$, y: True$): True$; 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__assignment.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 91 4 3 expression: "\nfn go(x) {\n let y = case x {\n True -> 1\n _ -> 0\n }\n y\n}\n" 5 4 --- 6 5 function go(x) { ··· 13 12 })(); 14 13 return y; 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__called_case.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 150 4 3 expression: "\nfn go(x, y) {\n case x {\n 0 -> y\n _ -> y\n }()\n}\n" 5 4 --- 6 5 function go(x, y) { ··· 12 11 } 13 12 })()(); 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__case_local_var_in_tuple.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 165 4 3 expression: "\nfn go(x, y) {\n let z = False\n case True {\n x if #(x, z) == #(True, False) -> x\n _ -> False\n }\n}\n" 5 4 --- 6 5 import { isEqual } from "../gleam.mjs"; ··· 15 14 return false; 16 15 } 17 16 } 18 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__following_todo.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 20 4 3 expression: "\nfn go(x) {\n case x {\n True -> todo\n _ -> 1\n }\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 19 18 return 1; 20 19 } 21 20 } 22 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__multi_subject_catch_all.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 34 4 3 expression: "\nfn go(x, y) {\n case x, y {\n True, True -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 function go(x, y) { ··· 10 9 return 0; 11 10 } 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__multi_subject_no_catch_all.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 62 4 3 expression: "\nfn go(x, y) {\n case x, y {\n True, _ -> 1\n _, True -> 2\n False, False -> 0\n }\n}\n" 5 4 --- 6 5 function go(x, y) { ··· 12 11 return 0; 13 12 } 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__multi_subject_or.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 48 4 3 expression: "\nfn go(x, y) {\n case x, y {\n True, _ | _, True -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 function go(x, y) { ··· 12 11 return 0; 13 12 } 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__multi_subject_subject_assignments.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 77 4 3 expression: "\nfn go() {\n case True, False {\n True, True -> 1\n _, _ -> 0\n }\n}\n" 5 4 --- 6 5 function go() { ··· 12 11 return 0; 13 12 } 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__pipe.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 122 4 3 expression: "\nfn go(x, f) {\n case x |> f {\n 0 -> 1\n _ -> 2\n }\n}\n" 5 4 --- 6 5 function go(x, f) { ··· 14 13 return 2; 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__pointless.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 6 4 3 expression: "\nfn go(x) {\n case x {\n _ -> x\n }\n}\n" 5 4 --- 6 5 function go(x) { 7 6 return x; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__preassign_assignment.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 106 4 3 expression: "\nfn go(x) {\n let y = case x() {\n True -> 1\n _ -> 0\n }\n y\n}\n" 5 4 --- 6 5 function go(x) { ··· 14 13 })(); 15 14 return y; 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case__result.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case.rs 3 - assertion_line: 136 4 3 expression: "\nfn go(x) {\n case x {\n Ok(_) -> 1\n Error(_) -> 0\n }\n}\n" 5 4 --- 6 5 function go(x) { ··· 10 9 return 0; 11 10 } 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__alternative_patterns.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 150 4 3 expression: "pub fn main(xs) {\n case xs {\n 1 | 2 -> 0\n _ -> 1\n }\n}\n" 5 4 --- 6 5 export function main(xs) { ··· 12 11 return 1; 13 12 } 14 13 } 15 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__alternative_patterns_assignment.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 176 4 - expression: "pub fn main(xs) -> Int {\n case xs {\n [x] | [_, x] -> x\n _ -> 1\n }\n} \n" 3 + expression: "pub fn main(xs) -> Int {\n case xs {\n [x] | [_, x] -> x\n _ -> 1\n }\n}\n" 5 4 --- 6 5 export function main(xs) { 7 6 if (xs.hasLength(1)) { ··· 14 13 return 1; 15 14 } 16 15 } 17 -
+1 -1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__alternative_patterns_guard.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - expression: "pub fn main(xs) -> Int {\n case xs {\n [x] | [_, x] if x == 1 -> x\n _ -> 0\n }\n} \n" 3 + expression: "pub fn main(xs) -> Int {\n case xs {\n [x] | [_, x] if x == 1 -> x\n _ -> 0\n }\n}\n" 4 4 --- 5 5 export function main(xs) { 6 6 if (xs.hasLength(1) && (xs.head === 1)) {
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__alternative_patterns_list.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 163 4 3 expression: "pub fn main(xs) -> Int {\n case xs {\n [1] | [1, 2] -> 0\n _ -> 1\n }\n}\n" 5 4 --- 6 5 export function main(xs) { ··· 12 11 return 1; 13 12 } 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__constant.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 137 4 3 expression: "pub fn main(xs) {\n case xs {\n #(x) if x == 1 -> x\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main(xs) { ··· 11 10 return 0; 12 11 } 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__eq_complex.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 124 4 3 expression: "pub fn main(xs, y) {\n case xs {\n #(x) if xs == y -> x\n _ -> 0\n }\n}\n" 5 4 --- 6 5 import { isEqual } from "../gleam.mjs"; ··· 13 12 return 0; 14 13 } 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__eq_scalar.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 72 4 3 expression: "pub fn main(xs, y: Int) {\n case xs {\n #(x) if x == y -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main(xs, y) { ··· 11 10 return 0; 12 11 } 13 12 } 14 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__field_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 202 4 - expression: "\n pub type Person {\n Person(username: String, name: String, age: Int)\n }\n \n pub fn main() {\n let given_name = \"jack\"\n let raiden = Person(\"raiden\", \"jack\", 31)\n \n case given_name {\n name if name == raiden.name -> \"It's jack\"\n _ -> \"It's not jack\"\n }\n }\n " 3 + expression: "\n pub type Person {\n Person(username: String, name: String, age: Int)\n }\n pub fn main() {\n let given_name = \"jack\"\n let raiden = Person(\"raiden\", \"jack\", 31)\n case given_name {\n name if name == raiden.name -> \"It's jack\"\n _ -> \"It's not jack\"\n }\n }\n " 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; 7 6 ··· 24 23 return "It's not jack"; 25 24 } 26 25 } 27 -
-24
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__guards_cause_badmatch_to_render.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 5 4 - expression: "pub fn main(x, y) {\n case x {\n 1 -> 1\n _ if y -> 0\n }\n}\n" 5 - --- 6 - import { makeError } from "../gleam.mjs"; 7 - 8 - export function main(x, y) { 9 - if (x === 1) { 10 - return 1; 11 - } else if (y) { 12 - return 0; 13 - } else { 14 - throw makeError( 15 - "case_no_match", 16 - "my/mod", 17 - 2, 18 - "main", 19 - "No case clause matched", 20 - { values: [x] } 21 - ) 22 - } 23 - } 24 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__module_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 249 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Tony Stark\"\n case name {\n n if n == hero.ironman.name -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 import * as $hero from "../../package/hero.mjs"; ··· 14 13 return false; 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__module_list_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 272 4 3 expression: "\n import hero\n pub fn main() {\n let names = [\"Tony Stark\", \"Bruce Wayne\"]\n case names {\n n if n == hero.heroes -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 import * as $hero from "../../package/hero.mjs"; ··· 15 14 return false; 16 15 } 17 16 } 18 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__module_nested_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 275 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Bruce Wayne\"\n case name {\n n if n == hero.batman.secret_identity.name -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 import * as $hero from "../../package/hero.mjs"; ··· 14 13 return false; 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__module_string_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 249 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Tony Stark\"\n case name {\n n if n == hero.ironman -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 import * as $hero from "../../package/hero.mjs"; ··· 14 13 return false; 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__module_tuple_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 295 4 3 expression: "\n import hero\n pub fn main() {\n let name = \"Tony Stark\"\n case name {\n n if n == hero.hero.1 -> True\n _ -> False\n }\n }\n " 5 4 --- 6 5 import * as $hero from "../../package/hero.mjs"; ··· 14 13 return false; 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__nested_record_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 223 4 3 expression: "\npub type A {\n A(b: B)\n}\n\npub type B {\n B(c: C)\n}\n\npub type C {\n C(d: Bool)\n}\n\npub fn a(a: A) {\n case a {\n _ if a.b.c.d -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 33 32 return 0; 34 33 } 35 34 } 36 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__not.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 374 4 3 expression: "pub fn main(x, y) {\n case x {\n _ if !y -> 0\n _ -> 1\n }\n}\n" 5 4 --- 6 5 export function main(x, y) { ··· 10 9 return 1; 11 10 } 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__not_eq_complex.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 111 4 3 expression: "pub fn main(xs, y) {\n case xs {\n #(x) if xs != y -> x\n _ -> 0\n }\n}\n" 5 4 --- 6 5 import { isEqual } from "../gleam.mjs"; ··· 13 12 return 0; 14 13 } 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__not_eq_scalar.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 85 4 3 expression: "pub fn main(xs, y: Int) {\n case xs {\n #(x) if x != y -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main(xs, y) { ··· 11 10 return 0; 12 11 } 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__not_two.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 387 4 3 expression: "pub fn main(x, y) {\n case x {\n _ if !y && !x -> 0\n _ -> 1\n }\n}\n" 5 4 --- 6 5 export function main(x, y) { ··· 10 9 return 1; 11 10 } 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__operator_wrapping_left.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 59 4 3 expression: "pub fn main(xs, y: Bool, z: Bool) {\n case xs {\n #(x) if { x == y } == z -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main(xs, y, z) { ··· 11 10 return 0; 12 11 } 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__operator_wrapping_right.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 46 4 3 expression: "pub fn main(xs, y: Bool, z: Bool) {\n case xs {\n #(x) if x == { y == z } -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main(xs, y, z) { ··· 11 10 return 0; 12 11 } 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__rebound_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 31 4 3 expression: "pub fn main() {\n let x = False\n let x = True\n case x {\n _ if x -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main() { ··· 12 11 return 0; 13 12 } 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__referencing_pattern_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 18 4 3 expression: "pub fn main(xs) {\n case xs {\n #(x) if x -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main(xs) { ··· 11 10 return 0; 12 11 } 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__case_clause_guards__tuple_index.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/case_clause_guards.rs 3 - assertion_line: 98 4 3 expression: "pub fn main(x, xs: #(Bool, Bool, Bool)) {\n case x {\n _ if xs.2 -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 export function main(x, xs) { ··· 10 9 return 0; 11 10 } 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_imported_ignoring_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 512 4 3 expression: "import other\npub const main = other.Two(1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 8 7 export const main = new $other.Two(1); 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_imported_multiple_fields.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 540 4 3 expression: "import other\npub const main = other.Two(b: 2, c: 3, a: 1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 8 7 export const main = new $other.Two(1, 2, 3); 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_imported_no_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 502 4 3 expression: "import other\npub const main = other.Two(1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 8 7 export const main = new $other.Two(1); 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_imported_using_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 526 4 3 expression: "import other\npub const main = other.Two(field: 1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 8 7 export const main = new $other.Two(1); 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_unqualified_imported_ignoring_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 564 4 3 expression: "import other.{Two}\npub const main = Two(1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 import { Two } from "../other.mjs"; 8 7 9 8 export const main = new Two(1); 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_unqualified_imported_multiple_fields.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 592 4 3 expression: "import other.{Two}\npub const main = Two(b: 2, c: 3, a: 1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 import { Two } from "../other.mjs"; 8 7 9 8 export const main = new Two(1, 2, 3); 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_unqualified_imported_no_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 554 4 3 expression: "import other.{Two}\npub const main = Two(1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 import { Two } from "../other.mjs"; 8 7 9 8 export const main = new Two(1); 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_unqualified_imported_using_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 578 4 3 expression: "import other.{Two}\npub const main = Two(field: 1)\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 import { Two } from "../other.mjs"; 8 7 9 8 export const main = new Two(1); 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_with_fields.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 140 4 3 expression: "\ntype Mine {\n Mine(a: Int, b: Int)\n}\n\nconst labels = Mine(b: 2, a: 1)\nconst no_labels = Mine(3, 4)\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 16 15 const labels = new Mine(1, 2); 17 16 18 17 const no_labels = new Mine(3, 4); 19 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_with_fields_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 154 4 3 expression: "\npub type Mine {\n Mine(a: Int, b: Int)\n}\n\npub const labels = Mine(b: 2, a: 1)\npub const no_labels = Mine(3, 4)\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 17 16 export const labels: Mine$; 18 17 19 18 export const no_labels: Mine$; 20 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_zero_arity_imported.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 104 4 3 expression: "import other\nconst x = other.Two\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 8 7 const x = new $other.Two(); 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__const_zero_arity_imported_unqualified.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 114 4 3 expression: "import other.{Two}\nconst a = Two\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; 7 6 import { Two } from "../other.mjs"; 8 7 9 8 const a = new Two(); 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__constructor_as_value.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 472 4 3 expression: "import other\npub fn main() {\n other.Two\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 8 7 export function main() { 9 8 return (var0, var1, var2) => { return new $other.Two(var0, var1, var2); }; 10 9 } 11 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__custom_type_with_named_fields.snap
··· 44 44 const felix = new Cat("Felix", 12); 45 45 46 46 const tom = new Cat("Tom", 1); 47 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__destructure_custom_type_with_mixed_fields_first_unlabelled.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 297 4 3 expression: "\ntype Cat {\n Cat(String, cuteness: Int)\n}\n\nfn go(cat) {\n let Cat(x, y) = cat\n let Cat(cuteness: y, ..) = cat\n let Cat(x, cuteness: y) = cat\n x\n}\n\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 21 20 let y$2 = cat.cuteness; 22 21 return x$1; 23 22 } 24 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__destructure_custom_type_with_mixed_fields_second_unlabelled.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 316 4 3 expression: "\ntype Cat {\n Cat(name: String, Int)\n}\n\nfn go(cat) {\n let Cat(x, y) = cat\n let Cat(name: x, ..) = cat\n let Cat(y, name: x) = cat\n x\n}\n\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 21 20 let y$1 = cat[1]; 22 21 return x$2; 23 22 } 24 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__destructure_custom_type_with_named_fields.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 278 4 3 expression: "\ntype Cat {\n Cat(name: String, cuteness: Int)\n}\n\nfn go(cat) {\n let Cat(x, y) = cat\n let Cat(name: x, ..) = cat\n let assert Cat(cuteness: 4, name: x) = cat\n x\n}\n\n" 5 4 --- 6 5 import { CustomType as $CustomType, makeError } from "../gleam.mjs"; ··· 30 29 let x$2 = cat.name; 31 30 return x$2; 32 31 } 33 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__imported_ignoring_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 360 4 3 expression: "import other\npub fn main() {\n other.Two(1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 8 7 export function main() { 9 8 return new $other.Two(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__imported_multiple_fields.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 390 4 3 expression: "import other\npub fn main() {\n other.Two(b: 2, c: 3, a: 1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 8 7 export function main() { 9 8 return new $other.Two(1, 2, 3); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__imported_no_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 349 4 3 expression: "import other\npub fn main() {\n other.Two(1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 8 7 export function main() { 9 8 return new $other.Two(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__imported_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 606 4 3 expression: "import other.{Two}\n\npub fn main(x) {\n case x {\n Two(a: 1, ..) -> 1\n other.Two(b: 2, c: c, ..) -> c\n _ -> 3\n }\n}\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 16 15 return 3; 17 16 } 18 17 } 19 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__imported_using_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 375 4 3 expression: "import other\npub fn main() {\n other.Two(field: 1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 8 7 export function main() { 9 8 return new $other.Two(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__keyword_label_name.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 627 4 3 expression: "pub type Thing {\n Thing(in: Int, class: Nil)\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 12 11 this.class = class$; 13 12 } 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__long_name_variant_mixed_labels_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 225 4 3 expression: "\npub type TypeWithALongNameAndSeveralArguments{\n TypeWithALongNameAndSeveralArguments(String, String, String, a: String, b: String)\n}\n\npub const local = TypeWithALongNameAndSeveralArguments(\"one\", \"two\", \"three\", \"four\", \"five\")\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 24 23 export type TypeWithALongNameAndSeveralArguments$ = TypeWithALongNameAndSeveralArguments; 25 24 26 25 export const local: TypeWithALongNameAndSeveralArguments$; 27 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__long_name_variant_without_labels.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 209 4 3 expression: "\ntype TypeWithALongNameAndSeveralArguments{\n TypeWithALongNameAndSeveralArguments(String, String, String, String, String)\n}\n\n\nfn go() {\n TypeWithALongNameAndSeveralArguments\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 27 26 ); 28 27 }; 29 28 } 30 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__nested_pattern_with_labels.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 335 4 3 expression: "pub type Box(x) { Box(a: Int, b: x) }\nfn go(x) {\n case x {\n Box(a: _, b: Box(a: a, b: b)) -> a + b\n _ -> 1\n }\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 22 21 return 1; 23 22 } 24 23 } 25 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__new_type_import_syntax.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 685 4 3 expression: "\nimport a.{type A, A}\n\npub fn main() {\n A\n}\n" 5 4 --- 6 5 import * as $a from "../../package/a.mjs"; ··· 9 8 export function main() { 10 9 return new A(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__opaque_types_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 662 4 3 expression: "pub opaque type Animal {\n Cat(goes_outside: Bool)\n Dog(plays_fetch: Bool)\n}\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 18 17 } 19 18 20 19 export type Animal$ = Cat | Dog; 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__qualified.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 637 4 3 expression: "import other\n\npub fn main() {\n other.One\n}\n" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 8 7 export function main() { 9 8 return new $other.One(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__types_must_be_rendered_before_functions.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 674 4 3 expression: "\npub fn one() { One }\npub type One { One }\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 10 9 export function one() { 11 10 return new One(); 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unapplied_record_constructors_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 650 4 3 expression: "pub type Cat { Cat(name: String) }\n\npub fn return_unapplied_cat() {\n Cat\n}\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 14 13 export type Cat$ = Cat; 15 14 16 15 export function return_unapplied_cat(): (x0: string) => Cat$; 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unnamed_fields.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 168 4 3 expression: "\ntype Ip{\n Ip(String)\n}\n\nconst local = Ip(\"0.0.0.0\")\n\nfn build(x) {\n x(\"1.2.3.4\")\n}\n\nfn go() {\n build(Ip)\n Ip(\"5.6.7.8\")\n}\n\nfn destructure(x) {\n let Ip(raw) = x\n raw\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 27 26 } 28 27 29 28 const local = new Ip("0.0.0.0"); 30 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unnamed_fields_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 195 4 3 expression: "\npub type Ip{\n Ip(String)\n}\n\npub const local = Ip(\"0.0.0.0\")\n\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 14 13 export type Ip$ = Ip; 15 14 16 15 export const local: Ip$; 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_constructor_as_value.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 487 4 3 expression: "import other.{Two}\npub fn main() {\n Two\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 9 8 export function main() { 10 9 return (var0, var1, var2) => { return new Two(var0, var1, var2); }; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_ignoring_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 427 4 3 expression: "import other.{Two}\npub fn main() {\n Two(1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 9 8 export function main() { 10 9 return new Two(1); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_multiple_fields.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 457 4 3 expression: "import other.{Two}\npub fn main() {\n Two(b: 2, c: 3, a: 1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 9 8 export function main() { 10 9 return new Two(1, 2, 3); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_no_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 405 4 3 expression: "import other.{Two}\npub fn main() {\n Two(1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 9 8 export function main() { 10 9 return new Two(1); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_no_label_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 416 4 3 expression: "import other.{Two}\npub fn main() {\n Two(1)\n}" 5 4 --- 6 5 import type * as $other from "../other.d.mts"; 7 6 8 7 export function main(): $other.One$; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__unqualified_imported_using_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 442 4 3 expression: "import other.{Two}\npub fn main() {\n Two(field: 1)\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 9 8 export function main() { 10 9 return new Two(1); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 23 4 3 expression: "\ntype Mine {\n This\n ThatOneIsAMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchLongerVariant\n}\n\nconst this = This\nconst that = ThatOneIsAMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchLongerVariant\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 12 11 const this$ = new This(); 13 12 14 13 const that = new ThatOneIsAMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchLongerVariant(); 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 38 4 3 expression: "import other\npub fn main() {\n other.Two\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 8 7 export function main() { 9 8 return new $other.Two(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_typscript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 49 4 3 expression: "import other\npub fn main() {\n other.Two\n}" 5 4 --- 6 5 import type * as $other from "../other.d.mts"; 7 6 8 7 export function main(): $other.One$; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 60 4 3 expression: "import other.{Two}\npub fn main() {\n Two\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 9 8 export function main() { 10 9 return new Two(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_aliased.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 82 4 3 expression: "import other.{Two as Three}\npub fn main() {\n Three\n}" 5 4 --- 6 5 import * as $other from "../other.mjs"; ··· 9 8 export function main() { 10 9 return new Three(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_aliased_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 93 4 3 expression: "import other.{Two as Three}\npub fn main() {\n Three\n}" 5 4 --- 6 5 import type * as $other from "../other.d.mts"; 7 6 8 7 export function main(): $other.One$; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_imported_unqualified_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 71 4 3 expression: "import other.{Two}\npub fn main() {\n Two\n}" 5 4 --- 6 5 import type * as $other from "../other.d.mts"; 7 6 8 7 export function main(): $other.One$; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__custom_types__zero_arity_literal.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/custom_types.rs 3 - assertion_line: 6 4 3 expression: "\ntype Mine {\n This\n ThatOneIsAMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchLongerVariant\n}\n\nfn go() {\n This\n ThatOneIsAMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchLongerVariant\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 13 12 new This(); 14 13 return new ThatOneIsAMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchMuchLongerVariant(); 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__attribute_erlang.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 132 4 3 expression: "\n@external(erlang, \"one\", \"one_erl\")\npub fn one(x: Int) -> Int {\n todo\n}\n\npub fn main() {\n one(1)\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 19 18 export function main() { 20 19 return one(1); 21 20 } 22 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__attribute_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 148 4 3 expression: "\n@external(javascript, \"./one.mjs\", \"oneJs\")\npub fn one(x: Int) -> Int {\n todo\n}\n\npub fn main() {\n one(1)\n}\n" 5 4 --- 6 5 import { oneJs as one } from "./one.mjs"; ··· 10 9 export function main() { 11 10 return one(1); 12 11 } 13 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__both_externals_no_valid_impl.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 292 4 3 expression: "\n@external(javascript, \"one\", \"one\")\npub fn js() -> Nil\n\n@external(erlang, \"one\", \"one\")\npub fn erl() -> Nil\n\npub fn should_not_be_generated() {\n js()\n erl()\n}\n" 5 4 --- 6 5 import { one as js } from "one";
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__duplicate_import.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 59 4 3 expression: "\n@external(javascript, \"./the/module.mjs\", \"dup\")\npub fn one() -> Nil\n\n@external(javascript, \"./the/module.mjs\", \"dup\")\npub fn two() -> Nil\n" 5 4 --- 6 5 import { dup as one, dup as two } from "./the/module.mjs"; 7 6 8 7 export { one, two }; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__erlang_and_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 164 4 3 expression: "\n@external(erlang, \"one\", \"one\")\n@external(javascript, \"./one.mjs\", \"oneJs\")\npub fn one(x: Int) -> Int {\n todo\n}\n\npub fn main() {\n one(1)\n}\n" 5 4 --- 6 5 import { oneJs as one } from "./one.mjs"; ··· 10 9 export function main() { 11 10 return one(1); 12 11 } 13 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__erlang_bit_patterns.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 278 4 3 expression: "\npub fn should_not_be_generated(x) {\n case x {\n <<_, rest:bits>> -> rest\n _ -> x\n }\n}\n" 5 4 --- 6 5 export {}
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__erlang_only.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 264 4 3 expression: "\npub fn should_be_generated(x: Int) -> Int {\n x\n}\n\n@external(erlang, \"one\", \"one\")\npub fn should_not_be_generated(x: Int) -> Int\n" 5 4 --- 6 5 export function should_be_generated(x) {
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__external_fn_escaping.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 94 4 3 expression: "\n@external(javascript, \"./ffi.js\", \"then\")\npub fn then(a: a) -> b" 5 4 --- 6 5 import { then as then$ } from "./ffi.js"; 7 6 8 7 export { then$ }; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__external_type_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 82 4 3 expression: "pub type Queue(a)\n\n@external(javascript, \"queue\", \"new\")\npub fn new() -> Queue(a)\n" 5 4 --- 6 5 export type Queue$<I> = any; 7 6 8 7 export function new$(): Queue$<any>; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__inline_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 252 4 3 expression: "\n@external(javascript, \"blah\", \"(x => x)\")\npub fn one(x: Int) -> Int {\n 1\n}\n" 5 4 --- 6 5 error: Invalid JavaScript function ··· 11 10 12 11 The function `one` has an external JavaScript implementation but the 13 12 function name `(x => x)` is not valid. 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__module_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 10 4 3 expression: "\n@external(javascript, \"utils\", \"inspect\")\nfn show(x: anything) -> Nil" 5 4 --- 6 5 import { inspect as show } from "utils"; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__name_to_escape.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 72 4 3 expression: "\n@external(javascript, \"./the/module.mjs\", \"one\")\npub fn class() -> Nil\n" 5 4 --- 6 5 import { one as class$ } from "./the/module.mjs"; 7 6 8 7 export { class$ }; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__no_body.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 230 4 3 expression: "\n@external(javascript, \"one\", \"one\")\npub fn one(x: Int) -> Int\n" 5 4 --- 6 5 import { one } from "one"; 7 6 8 7 export { one }; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__no_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 240 4 3 expression: "\n@external(javascript, \"\", \"one\")\npub fn one(x: Int) -> Int {\n 1\n}\n" 5 4 --- 6 5 error: Invalid JavaScript module ··· 11 10 12 11 The function `one` has an external JavaScript implementation but the module 13 12 path `` is not valid. 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__pipe_variable_shadow.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 104 4 3 expression: "\n@external(javascript, \"module\", \"string\")\nfn name() -> String\n\npub fn main() {\n let name = name()\n name\n}\n" 5 4 --- 6 5 import { string as name } from "module"; ··· 9 8 let name$1 = name(); 10 9 return name$1; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__private_attribute_erlang.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 181 4 3 expression: "\n@external(erlang, \"one\", \"one_erl\")\nfn one(x: Int) -> Int {\n todo\n}\n\npub fn main() {\n one(1)\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 19 18 export function main() { 20 19 return one(1); 21 20 } 22 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__private_attribute_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 197 4 3 expression: "\n@external(javascript, \"./one.mjs\", \"oneJs\")\nfn one(x: Int) -> Int {\n todo\n}\n\npub fn main() {\n one(1)\n}\n" 5 4 --- 6 5 import { oneJs as one } from "./one.mjs"; ··· 8 7 export function main() { 9 8 return one(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__private_erlang_and_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 213 4 3 expression: "\n@external(erlang, \"one\", \"one\")\n@external(javascript, \"./one.mjs\", \"oneJs\")\nfn one(x: Int) -> Int {\n todo\n}\n\npub fn main() {\n one(1)\n}\n" 5 4 --- 6 5 import { oneJs as one } from "./one.mjs"; ··· 8 7 export function main() { 9 8 return one(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__pub_module_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 19 4 3 expression: "\n@external(javascript, \"utils\", \"inspect\")\npub fn show(x: anything) -> Nil" 5 4 --- 6 5 import { inspect as show } from "utils"; 7 6 8 7 export { show }; 9 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__pub_module_fn_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 28 4 3 expression: "\n@external(javascript, \"utils\", \"inspect\")\npub fn show(x: anything) -> Nil" 5 4 --- 6 5 export function show(x: any): undefined;
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__same_module_multiple_imports.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 46 4 3 expression: "\n@external(javascript, \"./the/module.mjs\", \"one\")\npub fn one() -> Nil\n\n@external(javascript, \"./the/module.mjs\", \"two\")\npub fn two() -> Nil\n" 5 4 --- 6 5 import { one, two } from "./the/module.mjs"; 7 6 8 7 export { one, two }; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__same_name_external.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 37 4 3 expression: "\n@external(javascript, \"thingy\", \"fetch\")\npub fn fetch(request: Nil) -> Nil" 5 4 --- 6 5 import { fetch } from "thingy"; 7 6 8 7 export { fetch }; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__tf_type_name_usage.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 120 4 3 expression: "\npub type TESTitem\n\n@external(javascript, \"it\", \"one\")\npub fn one(a: TESTitem) -> TESTitem\n" 5 4 --- 6 5 export type TESTitem$ = any; 7 6 8 7 export function one(a: TESTitem$): TESTitem$; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__externals__type_.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/externals.rs 3 - assertion_line: 5 4 3 expression: pub type Thing 5 4 --- 6 5 export {} 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__assert_last.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 305 4 3 expression: "pub fn main() {\n let assert x = 1\n}\n" 5 4 --- 6 5 export function main() { 7 6 let x = 1; 8 7 return x; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__bad_comma.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 412 4 3 expression: "\nfn function_with_a_long_name_that_is_intended_to_sit_right_on_the_limit() {\n Nil\n}\n\nfn identity(x) {\n x\n}\n\npub fn main() {\n function_with_a_long_name_that_is_intended_to_sit_right_on_the_limit()\n |> identity\n}\n" 5 4 --- 6 5 function function_with_a_long_name_that_is_intended_to_sit_right_on_the_limit() { ··· 15 14 let _pipe = function_with_a_long_name_that_is_intended_to_sit_right_on_the_limit(); 16 15 return identity(_pipe); 17 16 } 18 -
-9
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__block_with_function_literal.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/functions.rs 3 - expression: "pub fn main() {\n \n \n let a = fn(a) { a + 1 } (10)\n}\n" 4 - --- 5 - export function main() { 6 - let a = ((a) => { return a + 1; })(10); 7 - return a; 8 - } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__calling_fn_literal.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 146 4 3 expression: "pub fn main() {\n fn(x) { x }(1)\n}\n" 5 4 --- 6 5 export function main() { 7 6 return ((x) => { return x; })(1); 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__calling_functions.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 17 4 3 expression: "\npub fn twice(f: fn(t) -> t, x: t) -> t {\n f(f(x))\n}\npub fn add_one(x: Int) -> Int {\n x + 1\n}\npub fn add_two(x: Int) -> Int {\n twice(add_one, x)\n}\n\npub fn take_two(x: Int) -> Int {\n twice(fn(y) {y - 1}, x)\n}\n" 5 4 --- 6 5 export function twice(f, x) { ··· 18 17 export function take_two(x) { 19 18 return twice((y) => { return y - 1; }, x); 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__case_in_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 191 4 3 expression: "pub fn main(f, x) {\n f(case x {\n 1 -> 2\n _ -> 0\n })\n}\n" 5 4 --- 6 5 export function main(f, x) { ··· 14 13 })(), 15 14 ); 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__exported_functions.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 7 4 3 expression: "\npub fn add(x, y) {\n x + y\n}" 5 4 --- 6 5 export function add(x, y) { 7 6 return x + y; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__fn_return_fn_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 315 4 3 expression: "pub fn main(f: fn(Int) -> Int) {\n let func = fn(x, y) { f(x) + f(y) }\n func\n}\n" 5 4 --- 6 5 export function main(f: (x0: number) => number): (x0: number, x1: number) => number; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_formatting.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 38 4 3 expression: "\npub fn add(the_first_variable_that_should_be_added, the_second_variable_that_should_be_added) {\n the_first_variable_that_should_be_added + the_second_variable_that_should_be_added\n}" 5 4 --- 6 5 export function add( ··· 9 8 ) { 10 9 return the_first_variable_that_should_be_added + the_second_variable_that_should_be_added; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_formatting1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 48 4 3 expression: "\npub fn this_function_really_does_have_a_ludicrously_unfeasibly_long_name_for_a_function(x, y) {\nx + y\n}" 5 4 --- 6 5 export function this_function_really_does_have_a_ludicrously_unfeasibly_long_name_for_a_function( ··· 9 8 ) { 10 9 return x + y; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_formatting2.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 58 4 3 expression: "\npub fn add(x, y) {\nx + y\n}\n\npub fn long() {\n add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, add(1, 1)))))))))))))))\n}" 5 4 --- 6 5 export function add(x, y) { ··· 34 33 ), 35 34 ); 36 35 } 37 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_formatting3.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 72 4 3 expression: "\npub fn math(x, y) {\n fn() {\n x + y\n x - y\n 2 * x\n }\n}" 5 4 --- 6 5 export function math(x, y) { ··· 10 9 return 2 * x; 11 10 }; 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_formatting_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 86 4 3 expression: "\npub fn add(the_first_variable_that_should_be_added, the_second_variable_that_should_be_added) {\n the_first_variable_that_should_be_added + the_second_variable_that_should_be_added\n}" 5 4 --- 6 5 export function add( 7 6 the_first_variable_that_should_be_added: number, 8 7 the_second_variable_that_should_be_added: number 9 8 ): number; 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_formatting_typescript1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 96 4 3 expression: "\npub fn this_function_really_does_have_a_ludicrously_unfeasibly_long_name_for_a_function(x, y) {\nx + y\n}" 5 4 --- 6 5 export function this_function_really_does_have_a_ludicrously_unfeasibly_long_name_for_a_function( 7 6 x: number, 8 7 y: number 9 8 ): number; 10 -
-8
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_literal_get_properly_wrapped.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/functions.rs 3 - expression: "pub fn main() {\n fn(n) { n + 1 }(10)\n}\n" 4 - --- 5 - export function main() { 6 - return ((n) => { return n + 1; })(10); 7 - } 8 -
-8
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_literals_get_properly_wrapped-2.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/functions.rs 3 - expression: "pub fn main() {\n { fn(n) { n + 1 } }(10)\n}\n" 4 - --- 5 - export function main() { 6 - return ((n) => { return n + 1; })(10); 7 - } 8 -
-8
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_literals_get_properly_wrapped-3.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/functions.rs 3 - expression: "pub fn main() {\n { let a = fn(n) { n + 1 } }(10)\n}\n" 4 - --- 5 - export function main() { 6 - return ((n) => { return n + 1; })(10); 7 - } 8 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__function_literals_get_properly_wrapped.snap
··· 5 5 export function main() { 6 6 return ((n) => { return n + 1; })(10); 7 7 } 8 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__keyword_in_recursive_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 275 4 3 expression: "pub fn main(with: Int) -> Nil {\n main(with - 1)\n}\n" 5 4 --- 6 5 export function main(loop$with) { ··· 9 8 loop$with = with$ - 1; 10 9 } 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__let_last.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 295 4 3 expression: "pub fn main() {\n let x = 1\n}\n" 5 4 --- 6 5 export function main() { 7 6 let x = 1; 8 7 return x; 9 8 } 10 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__module_const_fn.snap
··· 17 17 export function use_compound() { 18 18 return compound[0](compound[1](42)); 19 19 } 20 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__module_const_fn1.snap
··· 7 7 export const int_identity_alias: (x0: number) => number; 8 8 9 9 export const compound: [(x0: number) => number, (x0: number) => number]; 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__multiple_discard.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 265 4 3 expression: "pub fn main(_, _, _) {\n 1\n}\n" 5 4 --- 6 5 export function main(_, _1, _2) { 7 6 return 1; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__no_recur_in_anon_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 180 4 3 expression: "pub fn main() {\n fn() { main() }\n 1\n}\n" 5 4 --- 6 5 export function main() { 7 6 () => { return main(); }; 8 7 return 1; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__pipe_last.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 134 4 3 expression: "fn id(x) { x }\npub fn main() {\n 1\n |> id\n}\n" 5 4 --- 6 5 function id(x) { ··· 11 10 let _pipe = 1; 12 11 return id(_pipe); 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__pipe_shadow_import.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 372 4 3 expression: "\n import foo.{println}\n pub fn main() {\n let println =\n \"oh dear\"\n |> println\n println\n }" 5 4 --- 6 5 import * as $foo from "../foo.mjs"; ··· 13 12 })(); 14 13 return println$1; 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__pipe_variable_rebinding.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 357 4 3 expression: "\npub fn main() {\n let version = 1 |> version()\n version\n}\n\npub fn version(n) {\n Ok(1)\n}" 5 4 --- 6 5 import { Ok } from "../gleam.mjs"; ··· 16 15 })(); 17 16 return version$1; 18 17 } 19 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__recursion_with_discards.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 169 4 3 expression: "pub fn main(f, _) {\n f()\n main(f, 1)\n}\n" 5 4 --- 6 5 export function main(loop$f, _) { ··· 11 10 1; 12 11 } 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__reserved_word_argument.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 254 4 3 expression: "pub fn main(with) {\n with\n}\n" 5 4 --- 6 5 export function main(with$) { 7 6 return with$; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__reserved_word_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 241 4 3 expression: "const in = 1\n\npub fn export() {\n in\n}\n" 5 4 --- 6 5 const in$ = 1; ··· 8 7 export function export$() { 9 8 return in$; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__reserved_word_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 204 4 3 expression: "pub fn class() {\n Nil\n}\n" 5 4 --- 6 5 export function class$() { 7 6 return undefined; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__reserved_word_imported.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 214 4 3 expression: "import for.{class}\n\npub fn export() {\n class()\n}\n" 5 4 --- 6 5 import * as $for from "../for.mjs"; ··· 9 8 export function export$() { 10 9 return class$(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__reserved_word_imported_alias.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 227 4 3 expression: "import for.{class as while} as function\n\npub fn export() {\n let delete = function.class\n while()\n}\n" 5 4 --- 6 5 import * as $function from "../for.mjs"; ··· 10 9 let delete$ = $function.class$; 11 10 return while$(); 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__reserved_word_in_function_arguments.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 285 4 3 expression: "pub fn main(arguments, eval) {\n #(arguments, eval)\n}\n" 5 4 --- 6 5 export function main(arguments$, eval$) { 7 6 return [arguments$, eval$]; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__shadowing_current.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 158 4 3 expression: "pub fn main() {\n let main = fn() { 0 }\n main()\n}\n" 5 4 --- 6 5 export function main() { 7 6 let main$1 = () => { return 0; }; 8 7 return main$1(); 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__tail_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 106 4 3 expression: "\npub fn count(xs, n) {\n case xs {\n [] -> n\n [_, ..xs] -> count(xs, n + 1)\n }\n}\n" 5 4 --- 6 5 export function count(loop$xs, loop$n) { ··· 16 15 } 17 16 } 18 17 } 19 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__tail_call_doesnt_clobber_tail_position_tracking.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 120 4 3 expression: "\npub fn loop(indentation) {\n case indentation > 0 {\n True -> loop(indentation - 1)\n False -> Nil\n }\n}\n" 5 4 --- 6 5 export function loop(loop$indentation) { ··· 14 13 } 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__variable_rewriting_in_anon_fn_with_matching_parameter.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 327 4 3 expression: "pub fn bad() {\n fn(state) {\n let state = state\n state\n }\n}\n" 5 4 --- 6 5 export function bad() { ··· 9 8 return state$1; 10 9 }; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__functions__variable_rewriting_in_anon_fn_with_matching_parameter_in_case.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/functions.rs 3 - assertion_line: 341 4 3 expression: "pub fn bad() {\n fn(state) {\n let state = case Nil {\n _ -> state\n }\n state\n }\n}\n" 5 4 --- 6 5 export function bad() { ··· 12 11 return state$1; 13 12 }; 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__fn_generics_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/generics.rs 3 - assertion_line: 5 4 3 expression: "pub fn identity(a) -> a {\n a\n}\n" 5 4 --- 6 5 export function identity<J>(a: J): J; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__record_generics_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/generics.rs 3 - assertion_line: 15 4 3 expression: "pub type Animal(t) {\n Cat(type_: t)\n Dog(type_: t)\n}\n\npub fn main() {\n Cat(type_: 6)\n}\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 20 19 export type Animal$<I> = Cat<I> | Dog<I>; 21 20 22 21 export function main(): Animal$<number>; 23 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__result_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/generics.rs 3 - assertion_line: 40 4 3 expression: "pub fn map(result, fun) {\n case result {\n Ok(a) -> Ok(fun(a))\n Error(e) -> Error(e)\n }\n }" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 9 8 V, 10 9 S 11 10 >; 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__task_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/generics.rs 3 - assertion_line: 52 4 3 expression: "pub type Promise(value)\n pub type Task(a) = fn() -> Promise(a)" 5 4 --- 6 5 export type Promise$<I> = any; 7 6 8 7 export type Task = () => Promise$<any>; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__generics__tuple_generics_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/generics.rs 3 - assertion_line: 30 4 3 expression: "pub fn make_tuple(x: t) -> #(Int, t, Int) {\n #(0, x, 1)\n}\n" 5 4 --- 6 5 export function make_tuple<I>(x: I): [number, I, number]; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__case.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/lists.rs 3 - assertion_line: 89 4 3 expression: "\nfn go(xs) {\n case xs {\n [] -> 0\n [_] -> 1\n [_, _] -> 2\n _ -> 9999\n }\n}\n" 5 4 --- 6 5 function go(xs) { ··· 14 13 return 9999; 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__equality.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/lists.rs 3 - assertion_line: 77 4 3 expression: "\nfn go() {\n [] == [1]\n [] != [1]\n}\n" 5 4 --- 6 5 import { toList, isEqual } from "../gleam.mjs"; ··· 9 8 isEqual(toList([]), toList([1])); 10 9 return !isEqual(toList([]), toList([1])); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__list_constants.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/lists.rs 3 - assertion_line: 42 4 3 expression: "\nconst a = []\nconst b = [1, 2, 3]\n" 5 4 --- 6 5 import { toList } from "../gleam.mjs"; ··· 8 7 const a = toList([]); 9 8 10 9 const b = toList([1, 2, 3]); 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__list_constants_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/lists.rs 3 - assertion_line: 52 4 3 expression: "\npub const a = []\npub const b = [1, 2, 3]\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; ··· 8 7 export const a: _.List<any>; 9 8 10 9 export const b: _.List<number>; 11 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__list_destructuring.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/lists.rs 3 - assertion_line: 62 4 - expression: "\nfn go(x, y) {\n let [] = x\n let [a] = x\n let [1, 2] = x\n let [_, #(3, b)] = y\n let [head, ..tail] = y\n}\n" 3 + expression: "\nfn go(x, y) {\n let assert [] = x\n let assert [a] = x\n let assert [1, 2] = x\n let assert [_, #(3, b)] = y\n let assert [head, ..tail] = y\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 62 61 let tail = y.tail; 63 62 return y; 64 63 } 65 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__long_list_literals.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/lists.rs 3 - assertion_line: 19 4 3 expression: "\nfn go() {\n [111111111111111111111111111111111111111111111111111111111111111111111111]\n [11111111111111111111111111111111111111111111, 1111111111111111111111111111111111111111111]\n}\n" 5 4 --- 6 5 import { toList } from "../gleam.mjs"; ··· 14 13 1111111111111111111111111111111111111111111, 15 14 ]); 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__lists__multi_line_list_literals.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/lists.rs 3 - assertion_line: 31 4 3 expression: "\nfn go(x) {\n [{True 1}]\n}\n" 5 4 --- 6 5 import { toList } from "../gleam.mjs"; ··· 13 12 })(), 14 13 ]); 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__alias_aliased_constant.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 59 4 3 expression: "\nimport rocket_ship.{ x as y }\nconst z = y\n" 5 4 --- 6 5 import * as $rocket_ship from "../rocket_ship.mjs"; 7 6 import { x as y } from "../rocket_ship.mjs"; 8 7 9 8 const z = y; 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__alias_constant.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 96 4 3 expression: "\nimport rocket_ship as boop\npub fn go() { boop.x }\n" 5 4 --- 6 5 import * as $boop from "../rocket_ship.mjs"; ··· 8 7 export function go() { 9 8 return $boop.x; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__alias_fn_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 107 4 3 expression: "\nimport rocket_ship as boop\npub fn go() { boop.go() }\n" 5 4 --- 6 5 import * as $boop from "../rocket_ship.mjs"; ··· 8 7 export function go() { 9 8 return $boop.go(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__aliased_unqualified_fn_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 22 4 3 expression: "import rocket_ship.{launch as boom_time}\npub fn go() { boom_time() }\n" 5 4 --- 6 5 import * as $rocket_ship from "../rocket_ship.mjs"; ··· 9 8 export function go() { 10 9 return boom_time(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__constant.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 48 4 3 expression: "\nimport rocket_ship\npub fn go() { rocket_ship.x }\n" 5 4 --- 6 5 import * as $rocket_ship from "../rocket_ship.mjs"; ··· 8 7 export function go() { 9 8 return $rocket_ship.x; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__different_package_import.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 136 4 3 expression: "import one\npub fn go() { one.go() }\n" 5 4 --- 6 5 import * as $one from "../../other_package/one.mjs"; ··· 8 7 export function go() { 9 8 return $one.go(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__discarded_duplicate_import.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 210 4 3 expression: "\nimport esa/rocket_ship\nimport nasa/rocket_ship as _nasa_rocket\npub fn go() { rocket_ship.go() }\n" 5 4 --- 6 5 import * as $rocket_ship from "../esa/rocket_ship.mjs"; ··· 8 7 export function go() { 9 8 return $rocket_ship.go(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__discarded_duplicate_import_with_unqualified.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 223 4 3 expression: "\nimport esa/rocket_ship\nimport nasa/rocket_ship.{go} as _nasa_rocket\npub fn esa_go() { rocket_ship.go() }\npub fn nasa_go() { go() }\n" 5 4 --- 6 5 import * as $rocket_ship from "../esa/rocket_ship.mjs"; ··· 13 12 export function nasa_go() { 14 13 return go(); 15 14 } 16 -
-10
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_custom_types_do_get_rendered_in_typescript.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 182 4 - expression: "import one/two/three.{Custom, One, Two}\n\npub fn go() -> List(Custom) { [One, Two] }\n" 5 - --- 6 - import type * as _ from "../gleam.d.mts"; 7 - import type * as $three from "../one/two/three.d.mts"; 8 - 9 - export function go(): _.List<$three.Custom$>; 10 -
-13
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_custom_types_dont_get_rendered.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 167 4 - expression: "import one/two/three.{Custom, One, Two}\n\npub fn go() -> List(Custom) { [One, Two] }\n" 5 - --- 6 - import { toList } from "../gleam.mjs"; 7 - import * as $three from "../one/two/three.mjs"; 8 - import { One, Two } from "../one/two/three.mjs"; 9 - 10 - export function go() { 11 - return toList([new One(), new Two()]); 12 - } 13 -
-11
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_external_types_dont_get_rendered.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 156 4 - expression: "import one/two/three.{External}\n\npub fn go() { 1 }\n" 5 - --- 6 - import * as $three from "../one/two/three.mjs"; 7 - 8 - export function go() { 9 - return 1; 10 - } 11 -
-14
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__imported_external_types_dont_get_rendered_with_value_of_same_name.snap
··· 1 - --- 2 - source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 197 4 - expression: "import one/two/three.{Thingy}\n\ntype Dup { Thingy }\n\npub fn go(x: Thingy) -> List(Thingy) { [x, x] }\n" 5 - --- 6 - import { toList, CustomType as $CustomType } from "../gleam.mjs"; 7 - import * as $three from "../one/two/three.mjs"; 8 - 9 - class Thingy extends $CustomType {} 10 - 11 - export function go(x) { 12 - return toList([x, x]); 13 - } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__multiple_unqualified_fn_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 32 4 3 expression: "import rocket_ship.{a,b as bb}\npub fn go() { a() + bb() }\n" 5 4 --- 6 5 import * as $rocket_ship from "../rocket_ship.mjs"; ··· 9 8 export function go() { 10 9 return a() + bb(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__nested_fn_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 118 4 3 expression: "import one/two\npub fn go() { two.go() }" 5 4 --- 6 5 import * as $two from "../one/two.mjs"; ··· 8 7 export function go() { 9 8 return $two.go(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__nested_module_constant.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 81 4 3 expression: "\nimport rocket_ship/launcher\npub fn go() { launcher.x }\n" 5 4 --- 6 5 import * as $launcher from "../rocket_ship/launcher.mjs"; ··· 8 7 export function go() { 9 8 return $launcher.x; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__nested_nested_fn_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 127 4 3 expression: "import one/two/three\npub fn go() { three.go() }" 5 4 --- 6 5 import * as $three from "../one/two/three.mjs"; ··· 8 7 export function go() { 9 8 return $three.go(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__nested_same_package.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 146 4 3 expression: "import one/two/three\npub fn go() { three.go() }\n" 5 4 --- 6 5 import * as $three from "../one/two/three.mjs"; ··· 8 7 export function go() { 9 8 return $three.go(); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__renamed_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 70 4 3 expression: "\nimport x as y\nconst z = y.v\n" 5 4 --- 6 5 import * as $y from "../x.mjs"; 7 6 8 7 const z = $y.v; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__modules__unqualified_fn_call.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/modules.rs 3 - assertion_line: 12 4 3 expression: "import rocket_ship.{launch}\npub fn go() { launch() }\n" 5 4 --- 6 5 import * as $rocket_ship from "../rocket_ship.mjs"; ··· 9 8 export function go() { 10 9 return launch(); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__float_equality.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 139 4 3 expression: "\nfn go() {\n 1.0 != 2.0\n 1.0 == 2.0\n}\n" 5 4 --- 6 5 function go() { 7 6 1.0 !== 2.0; 8 7 return 1.0 === 2.0; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__float_equality1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 151 4 3 expression: "\nfn go(y) {\n let x = 1.0\n x == y\n}\n" 5 4 --- 6 5 function go(y) { 7 6 let x = 1.0; 8 7 return x === y; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__float_literals.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 23 4 3 expression: "\nfn go() {\n 1.5\n 2.0\n -0.1\n 1.\n}\n" 5 4 --- 6 5 function go() { ··· 9 8 -0.1; 10 9 return 1.; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__float_operators.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 74 4 3 expression: "\nfn go() {\n 1.0 +. 1.4 // => 2.4\n 5.0 -. 1.5 // => 3.5\n 5.0 /. 2.0 // => 2.5\n 3.0 *. 3.1 // => 9.3\n \n 2.0 >. 1.0 // => True\n 2.0 <. 1.0 // => False\n 2.0 >=. 1.0 // => True\n 2.0 <=. 1.0 // => False\n}\n" 5 4 --- 6 5 import { divideFloat } from "../gleam.mjs"; ··· 15 14 2.0 >= 1.0; 16 15 return 2.0 <= 1.0; 17 16 } 18 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__float_scientific_literals.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 37 4 3 expression: "\nfn go() {\n 0.01e-1\n 0.01e-0\n -10.01e-1\n -10.01e-0\n 100.001e523\n -100.001e-523\n 100.001e123_456_789\n -100.001e-123_456_789\n}\n" 5 4 --- 6 5 function go() { ··· 13 12 100.001e123_456_789; 14 13 return -100.001e-123_456_789; 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_equality.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 115 4 3 expression: "\nfn go() {\n 1 != 2\n 1 == 2\n}\n" 5 4 --- 6 5 function go() { 7 6 1 !== 2; 8 7 return 1 === 2; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_equality1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 127 4 3 expression: "\nfn go(y) {\n let x = 1\n x == y\n}\n" 5 4 --- 6 5 function go(y) { 7 6 let x = 1; 8 7 return x === y; 9 8 } 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_literals.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 5 4 3 expression: "\nfn go() {\n 1\n 2\n -3\n 4001\n 0b00001111\n 0o17\n 0xF\n 1_000\n}\n" 5 4 --- 6 5 function go() { ··· 13 12 0xF; 14 13 return 1_000; 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_negation.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 185 4 3 expression: "\nfn go() {\n let a = 3\n let b = -a\n}\n" 5 4 --- 6 5 function go() { ··· 8 7 let b = - a; 9 8 return b; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_operators.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 55 4 3 expression: "\nfn go() {\n 1 + 1 // => 2\n 5 - 1 // => 4\n 5 / 2 // => 2\n 3 * 3 // => 9\n 5 % 2 // => 1\n 2 > 1 // => True\n 2 < 1 // => False\n 2 >= 1 // => True\n 2 <= 1 // => False\n}\n" 5 4 --- 6 5 import { remainderInt, divideInt } from "../gleam.mjs"; ··· 16 15 2 >= 1; 17 16 return 2 <= 1; 18 17 } 19 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__int_patterns.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 104 4 - expression: "\nfn go(x) {\n let 4 = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert 4 = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 18 17 } 19 18 return x; 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__operator_precedence.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 163 4 3 expression: "\nfn go() {\n 2.4 *. { 3.5 +. 6.0 }\n}\n" 5 4 --- 6 5 function go() { 7 6 return 2.4 * (3.5 + 6.0); 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__preceeding_zeros_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 222 4 3 expression: "\nfn main() {\n 09_179.1\n}\n" 5 4 --- 6 5 function main() { 7 6 return 9_179.1; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__preceeding_zeros_float_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 244 4 3 expression: "\nconst x = 09_179.1\n" 5 4 --- 6 5 const x = 9_179.1; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__preceeding_zeros_float_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 266 4 3 expression: "\nfn main(x) {\n let assert 09_179.1 = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 18 17 } 19 18 return x; 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__preceeding_zeros_int.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 210 4 3 expression: "\nfn main() {\n 09_179\n}\n" 5 4 --- 6 5 function main() { 7 6 return 9_179; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__preceeding_zeros_int_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 234 4 3 expression: "\nconst x = 09_179\n" 5 4 --- 6 5 const x = 9_179; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__preceeding_zeros_int_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 254 4 3 expression: "\nfn main(x) {\n let assert 09_179 = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 18 17 } 19 18 return x; 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__remainder.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 174 4 3 expression: "\nfn go() {\n 5 % 0 // => 0\n}\n" 5 4 --- 6 5 import { remainderInt } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 return remainderInt(5, 0); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__repeated_int_negation.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 197 4 3 expression: "\nfn go() {\n let a = 3\n let b = --a\n}\n" 5 4 --- 6 5 function go() { ··· 8 7 let b = - - a; 9 8 return b; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__numbers__wide_float_div.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/numbers.rs 3 - assertion_line: 93 4 3 expression: "\nfn go() {\n 111111111111111111111111111111. /. 22222222222222222222222222222222222.\n}\n" 5 4 --- 6 5 import { divideFloat } from "../gleam.mjs"; ··· 11 10 22222222222222222222222222222222222. 12 11 ); 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__panic__bare_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/panic.rs 3 - assertion_line: 16 4 3 expression: "\npub fn go() {\n panic\n}\n" 5 4 --- 6 5 export function go(): any; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/prelude.rs 3 - assertion_line: 23 4 3 expression: "import gleam\npub fn go() { gleam.Error(1) }\n" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 8 7 export function go() { 9 8 return new $gleam.Error(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_nil.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/prelude.rs 3 - assertion_line: 32 4 3 expression: "import gleam\npub fn go() { gleam.Nil }\n" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 8 7 export function go() { 9 8 return undefined; 10 9 } 11 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_nil_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/prelude.rs 3 - assertion_line: 41 4 3 expression: "import gleam\npub fn go() { gleam.Nil }\n" 5 4 --- 6 5 import type * as $gleam from "../gleam.d.mts";
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_ok.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/prelude.rs 3 - assertion_line: 5 4 3 expression: "import gleam\npub fn go() { gleam.Ok(1) }\n" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 8 7 export function go() { 9 8 return new $gleam.Ok(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__prelude__qualified_ok_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/prelude.rs 3 - assertion_line: 14 4 3 expression: "import gleam\npub fn go() { gleam.Ok(1) }\n" 5 4 --- 6 5 import type * as $gleam from "../gleam.d.mts"; 7 6 import type * as _ from "../gleam.d.mts"; 8 7 9 8 export function go(): _.Result<number, any>; 10 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__records__record_accessor_multiple_variants.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/records.rs 3 - assertion_line: 18 4 3 expression: "\npub type Person {\n Teacher(name: String, title: String)\n Student(name: String, age: Int)\n}\npub fn get_name(person: Person) { person.name }" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 24 23 export function get_name(person) { 25 24 return person.name; 26 25 } 27 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__records__record_accessor_multiple_variants_parameterised_types.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/records.rs 3 - assertion_line: 61 4 3 expression: "\npub type Person {\n Teacher(name: String, age: List(Int), title: String)\n Student(name: String, age: List(Int))\n}\npub fn get_name(person: Person) { person.name }\npub fn get_age(person: Person) { person.age }" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 29 28 export function get_age(person) { 30 29 return person.age; 31 30 } 32 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__records__record_accessor_multiple_variants_positions_other_than_first.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/records.rs 3 - assertion_line: 32 4 3 expression: "\npub type Person {\n Teacher(name: String, age: Int, title: String)\n Student(name: String, age: Int)\n}\npub fn get_name(person: Person) { person.name }\npub fn get_age(person: Person) { person.age }" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 29 28 export function get_age(person) { 30 29 return person.age; 31 30 } 32 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__records__record_accessor_multiple_with_first_position_different_types.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/records.rs 3 - assertion_line: 47 4 3 expression: "\npub type Person {\n Teacher(name: Nil, age: Int)\n Student(name: String, age: Int)\n}\npub fn get_age(person: Person) { person.age }" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 24 23 export function get_age(person) { 25 24 return person.age; 26 25 } 27 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__records__record_accessors.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/records.rs 3 - assertion_line: 6 4 3 expression: "\npub type Person { Person(name: String, age: Int) }\npub fn get_age(person: Person) { person.age }\npub fn get_name(person: Person) { person.name }\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 20 19 export function get_name(person) { 21 20 return person.name; 22 21 } 23 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__recursion__not_tco_due_to_assignment.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/recursion.rs 3 - assertion_line: 37 4 3 expression: "\npub fn main(x) {\n let z = {\n let y = x\n main(y - 1)\n }\n z\n}\n" 5 4 --- 6 5 export function main(x) { ··· 10 9 })(); 11 10 return z; 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__recursion__shadowing_so_not_recursive.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/recursion.rs 3 - assertion_line: 54 4 3 expression: "\npub fn map(map) {\n map()\n}\n" 5 4 --- 6 5 export function map(map) { 7 6 return map(); 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__recursion__tco.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/recursion.rs 3 - assertion_line: 5 4 3 expression: "\npub fn main(x) {\n case x {\n 0 -> Nil\n _ -> main(x - 1)\n }\n}\n" 5 4 --- 6 5 export function main(loop$x) { ··· 13 12 } 14 13 } 15 14 } 16 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__recursion__tco_case_block.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/recursion.rs 3 - assertion_line: 19 4 3 expression: "\npub fn main(x) {\n case x {\n 0 -> Nil\n _ -> {\n let y = x\n main(y - 1)\n }\n }\n}\n" 5 4 --- 6 5 export function main(loop$x) { ··· 14 13 } 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__aliased_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 65 4 3 expression: "import gleam.{Error as Thing}\npub fn main() { Thing(1) }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 9 8 export function main() { 10 9 return new Thing(1); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__aliased_error_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 81 4 3 expression: "import gleam.{Error as Thing}\npub fn main() { Thing }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 9 8 export function main() { 10 9 return (var0) => { return new Thing(var0); }; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__aliased_ok.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 57 4 3 expression: "import gleam.{Ok as Thing}\npub fn main() { Thing(1) }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 9 8 export function main() { 10 9 return new Thing(1); 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__aliased_ok_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 73 4 3 expression: "import gleam.{Ok as Thing}\npub fn main() { Thing }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 9 8 export function main() { 10 9 return (var0) => { return new Thing(var0); }; 11 10 } 12 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__error.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 10 4 3 expression: "pub fn main() { Error(1) }" 5 4 --- 6 5 import { Error } from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return new Error(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__error_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 20 4 3 expression: "pub fn main() { Error }" 5 4 --- 6 5 import { Error } from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return (var0) => { return new Error(var0); }; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__ok.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 5 4 3 expression: "pub fn main() { Ok(1) }" 5 4 --- 6 5 import { Ok } from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return new Ok(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__ok_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 15 4 3 expression: "pub fn main() { Ok }" 5 4 --- 6 5 import { Ok } from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return (var0) => { return new Ok(var0); }; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__qualified_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 33 4 3 expression: "import gleam\npub fn main() { gleam.Error(1) }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return new $gleam.Error(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__qualified_error_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 49 4 3 expression: "import gleam\npub fn main() { gleam.Error }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return (var0) => { return new $gleam.Error(var0); }; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__qualified_ok.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 25 4 3 expression: "import gleam\npub fn main() { gleam.Ok(1) }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return new $gleam.Ok(1); 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__results__qualified_ok_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/results.rs 3 - assertion_line: 41 4 3 expression: "import gleam\npub fn main() { gleam.Ok }" 5 4 --- 6 5 import * as $gleam from "../gleam.mjs"; ··· 8 7 export function main() { 9 8 return (var0) => { return new $gleam.Ok(var0); }; 10 9 } 11 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__ascii_as_unicode_escape_sequence.snap
··· 5 5 export function y() { 6 6 return "\u{79}"; 7 7 } 8 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__case.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 40 4 3 expression: "\nfn go(a) {\n case a {\n \"\" -> 0\n \"one\" -> 1\n \"two\" -> 2\n _ -> 3\n }\n}\n" 5 4 --- 6 5 function go(a) { ··· 14 13 return 3; 15 14 } 16 15 } 17 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__discard_concat_rest_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 107 4 3 expression: "\npub fn go(x) {\n case x {\n \"Hello, \" <> _ -> Nil\n _ -> Nil\n }\n}\n" 5 4 --- 6 5 export function go(x) { ··· 10 9 return undefined; 11 10 } 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__equality.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 27 4 3 expression: "\nfn go(a) {\n a == \"ok\"\n a != \"ok\"\n a == a\n}\n" 5 4 --- 6 5 function go(a) { ··· 8 7 a !== "ok"; 9 8 return a === a; 10 9 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_concat.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 56 4 3 expression: "\nfn go() {\n \"Hello, \" <> \"Joe\"\n}\n" 5 4 --- 6 5 function go() { 7 6 return "Hello, " + "Joe"; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_literals.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 5 4 3 expression: "\nfn go() {\n \"Hello, Gleam!\"\n}\n" 5 4 --- 6 5 function go() { 7 6 return "Hello, Gleam!"; 8 7 } 9 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_patterns.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 16 4 - expression: "\nfn go(x) {\n let \"Hello\" = x\n}\n" 3 + expression: "\nfn go(x) {\n let assert \"Hello\" = x\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 18 17 } 19 18 return x; 20 19 } 21 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_prefix.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 67 4 3 expression: "\npub fn go(x) {\n case x {\n \"Hello, \" <> name -> name\n _ -> \"Unknown\"\n }\n}\n" 5 4 --- 6 5 export function go(x) { ··· 11 10 return "Unknown"; 12 11 } 13 12 } 14 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_prefix_assignment.snap
··· 11 11 return "Unknown"; 12 12 } 13 13 } 14 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_prefix_assignment_with_multiple_subjects.snap
··· 13 13 return "Unknown"; 14 14 } 15 15 } 16 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_prefix_shadowing.snap
··· 11 11 return "Unknown"; 12 12 } 13 13 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__string_prefix_utf16.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/strings.rs 3 - assertion_line: 81 4 3 expression: "\npub fn go(x) {\n case \"Θ foo bar\" {\n \"Θ\" <> rest -> rest\n _ -> \"\"\n }\n case \"🫥 is neutral dotted\" {\n \"🫥\" <> rest -> rest\n _ -> \"\"\n }\n case \"🇺🇸 is a cluster\" {\n \"🇺🇸\" <> rest -> rest\n _ -> \"\"\n }\n case \"\\\" is a an escaped quote\" {\n \"\\\"\" <> rest -> rest\n _ -> \"\"\n }\n case \"\\\\ is a an escaped backslash\" {\n \"\\\\\" <> rest -> rest\n _ -> \"\"\n }\n}\n" 5 4 --- 6 5 export function go(x) { ··· 40 39 return ""; 41 40 } 42 41 } 43 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__unicode1.snap
··· 5 5 export function emoji() { 6 6 return "\u{1f600}"; 7 7 } 8 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__unicode2.snap
··· 5 5 export function y_with_dieresis() { 6 6 return "\u{0308}y"; 7 7 } 8 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__strings__unicode_escape_sequence_6_digits.snap
··· 5 5 export function unicode_escape_sequence_6_digits() { 6 6 return "\u{10abcd}"; 7 7 } 8 -
+1 -3
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__todo__as_expression.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/todo.rs 3 - assertion_line: 50 4 - expression: "\nfn go(f) {\n let boop = todo(\"I should do this\")\n f(todo(\"Boom\"))\n}\n" 3 + expression: "\nfn go(f) {\n let boop = todo as \"I should do this\"\n f(todo as \"Boom\")\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; 7 6 ··· 11 10 })(); 12 11 return f((() => { throw makeError("todo", "my/mod", 4, "go", "Boom", {}) })()); 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__todo__with_message.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/todo.rs 3 - assertion_line: 27 4 3 expression: "\nfn go() {\n todo as \"I should do this\"\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 8 7 function go() { 9 8 throw makeError("todo", "my/mod", 3, "go", "I should do this", {}) 10 9 } 11 -
-1
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__todo__with_message_expr.snap
··· 8 8 let x = "I should " + "do this"; 9 9 throw makeError("todo", "my/mod", 4, "go", x, {}) 10 10 } 11 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__todo__without_message.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/todo.rs 3 - assertion_line: 5 4 3 expression: "\nfn go() {\n todo\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 15 14 {} 16 15 ) 17 16 } 18 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__todo__without_message_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/todo.rs 3 - assertion_line: 16 4 3 expression: "\npub fn go() {\n todo\n}\n" 5 4 --- 6 5 export function go(): any; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__constant_tuples.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 85 4 3 expression: "\nconst a = \"Hello\"\nconst b = 1\nconst c = 2.0\nconst e = #(\"bob\", \"dug\")\n " 5 4 --- 6 5 const a = "Hello"; ··· 10 9 const c = 2.0; 11 10 12 11 const e = ["bob", "dug"]; 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__constant_tuples1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 97 4 3 expression: "\nconst e = #(\n \"loooooooooooooong\", \"loooooooooooong\", \"loooooooooooooong\",\n \"loooooooooooooong\", \"loooooooooooong\", \"loooooooooooooong\",\n)\n" 5 4 --- 6 5 const e = [ ··· 11 10 "loooooooooooong", 12 11 "loooooooooooooong", 13 12 ]; 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__tuple.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 5 4 3 expression: "\nfn go() {\n #(\"1\", \"2\", \"3\")\n}\n" 5 4 --- 6 5 function go() { 7 6 return ["1", "2", "3"]; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__tuple1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 16 4 3 expression: "\nfn go() {\n #(\n \"1111111111111111111111111111111\",\n #(\"1111111111111111111111111111111\", \"2\", \"3\"),\n \"3\",\n )\n}\n" 5 4 --- 6 5 function go() { ··· 10 9 "3", 11 10 ]; 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__tuple_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 42 4 3 expression: "\nfn go() {\n #(1, 2).0\n}\n" 5 4 --- 6 5 function go() { 7 6 return [1, 2][0]; 8 7 } 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__tuple_formatting_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 109 4 3 expression: "\npub const e = #(\n \"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\",\n \"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\",\n \"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\",\n)\n" 5 4 --- 6 5 export const e: [ ··· 26 25 string, 27 26 string 28 27 ]; 29 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__tuple_typescript.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 31 4 3 expression: "\npub fn go() {\n #(\"1\", \"2\", \"3\")\n}\n" 5 4 --- 6 5 export function go(): [string, string, string]; 7 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__tuple_with_block_element.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 53 4 3 expression: "\nfn go() {\n #(\n \"1\", \n {\n \"2\"\n \"3\"\n },\n )\n}\n" 5 4 --- 6 5 function go() { ··· 12 11 })(), 13 12 ]; 14 13 } 15 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__tuples__tuple_with_block_element1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/tuples.rs 3 - assertion_line: 70 4 3 expression: "\nfn go() {\n #(\n \"1111111111111111111111111111111\",\n #(\"1111111111111111111111111111111\", \"2\", \"3\"),\n \"3\",\n )\n}\n" 5 4 --- 6 5 function go() { ··· 10 9 "3", 11 10 ]; 12 11 } 13 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__type_alias__type_alias.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/type_alias.rs 3 - assertion_line: 5 4 3 expression: "\npub type Headers = List(#(String, String))\n" 5 4 --- 6 5 import type * as _ from "../gleam.d.mts"; 7 6 8 7 export type Headers = _.List<[string, string]>; 9 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__use___arity_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/use_.rs 3 - assertion_line: 5 4 3 expression: "\npub fn main() {\n use <- pair()\n 123\n}\n\nfn pair(f) {\n let x = f()\n #(x, x)\n}\n" 5 4 --- 6 5 function pair(f) { ··· 11 10 export function main() { 12 11 return pair(() => { return 123; }); 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__use___arity_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/use_.rs 3 - assertion_line: 22 4 3 expression: "\npub fn main() {\n use <- pair(1.0)\n 123\n}\n\nfn pair(x, f) {\n let y = f()\n #(x, y)\n}\n" 5 4 --- 6 5 function pair(x, f) { ··· 11 10 export function main() { 12 11 return pair(1.0, () => { return 123; }); 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__use___arity_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/use_.rs 3 - assertion_line: 39 4 3 expression: "\npub fn main() {\n use <- trip(1.0, \"\")\n 123\n}\n\nfn trip(x, y, f) {\n let z = f()\n #(x, y, z)\n}\n" 5 4 --- 6 5 function trip(x, y, f) { ··· 11 10 export function main() { 12 11 return trip(1.0, "", () => { return 123; }); 13 12 } 14 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__use___no_callback_body.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/use_.rs 3 - assertion_line: 56 4 3 expression: "\npub fn main() {\n let thingy = fn(f) { f() }\n use <- thingy()\n}\n" 5 4 --- 6 5 import { makeError } from "../gleam.mjs"; ··· 20 19 }, 21 20 ); 22 21 } 23 -
-2
compiler-core/src/javascript/tests/snapshots/gleam_core__javascript__tests__use___patterns.snap
··· 1 1 --- 2 2 source: compiler-core/src/javascript/tests/use_.rs 3 - assertion_line: 68 4 3 expression: "\npub fn main() {\n use Box(x) <- apply(Box(1))\n x\n}\n\ntype Box(a) {\n Box(a)\n}\n\nfn apply(arg, fun) {\n fun(arg)\n}\n" 5 4 --- 6 5 import { CustomType as $CustomType } from "../gleam.mjs"; ··· 25 24 }, 26 25 ); 27 26 } 28 -
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__generic_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 236 4 3 expression: "\npub type Wob(a) { Wob }\n@deprecated(\"deprecation message\")\npub fn main() { Wob }\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__imported_aliased_type_keeps_original_name.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 258 4 3 expression: "\nimport other_module.{type Element as Alias} as module_alias\npub fn main() -> Alias(module_alias.Element(a)) {}\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__imported_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 247 4 3 expression: "\nimport other_module.{type Element}\npub fn main() -> Element(Int) {}\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__internal_modules_are_not_exported.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 275 4 3 expression: "pub fn main() { 1 }" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__multiple_type_variables.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 269 4 3 expression: "\npub type Box(a, b)\npub fn some_type_variables(a: a, b: b, c: Box(c, d)) -> Box(a, d) {}\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__opaque_constructors_are_not_exposed.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 185 4 3 expression: "pub opaque type Wibble { Wob }" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__package_documentation_is_included.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 165 4 3 expression: "\n//// Some package\n//// documentation!\n\npub fn main() { 1 }\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__prelude_types.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 224 4 3 expression: "\npub const float = 1.1\npub const string = \"\"\npub const int = 1\npub const bool = True\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__private_definitions_are_not_included.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 173 4 3 expression: "\nconst float = 1.1\nfn main() {}\ntype Wibble\ntype Wob = Int\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__type_aliases.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 190 4 3 expression: pub type Wibble(a) = List(a) 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__type_constructors.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 263 4 3 expression: "\npub type Box(a, b) {\n Box(b, Int)\n OtherBox(message: String, a: a)\n}\n" 5 4 --- 6 5 {
-1
compiler-core/src/package_interface/snapshots/gleam_core__package_interface__tests__type_definition.snap
··· 1 1 --- 2 2 source: compiler-core/src/package_interface/tests.rs 3 - assertion_line: 195 4 3 expression: "\n/// Wibble's documentation\npub type Wibble(a, b) {\n Wob\n Baz\n}\n" 5 4 --- 6 5 {
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__argument_scope.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 441 4 3 expression: "\n1 + let a = 5\na\n" 5 4 --- 6 5 error: Syntax error ··· 10 9 │ ^ This operator has no value on its right side 11 10 12 11 Hint: Remove it or put a value after it. 13 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__assign_left_hand_side_of_concat_pattern.snap
··· 13 13 14 14 If you want to match one character consider using `pop_grapheme` 15 15 from the stdlib's `gleam/string` module. 16 -
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__attributes_with_improper_definition.snap
··· 8 8 2 │ ╭ @deprecated("1") 9 9 3 │ │ @external(erlang, "module", "fun") 10 10 │ ╰──────────────────────────────────^ I was expecting a function definition after this 11 - 12 -
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__attributes_with_no_definition.snap
··· 8 8 2 │ ╭ @deprecated("1") 9 9 3 │ │ @target(erlang) 10 10 │ ╰───────────────^ I was expecting a definition after this 11 - 12 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__bare_expression.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 417 4 3 expression: "1" 5 4 --- 6 5 [
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__block_of_one.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 423 4 3 expression: "{ 1 }" 5 4 --- 6 5 [
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__block_of_two.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 429 4 3 expression: "{ 1 2 }" 5 4 --- 6 5 [
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__capture_with_name.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 711 4 3 expression: "\npub fn main() {\n add(_name, 1)\n}\n\nfn add(x, y) {\n x + y\n}\n" 5 4 --- 6 5 error: Syntax error ··· 12 11 Expected one of: 13 12 An expression 14 13 An underscore 15 -
-16
compiler-core/src/parse/snapshots/gleam_core__parse__tests__deprecated_option_binary_const.snap
··· 1 - --- 2 - source: compiler-core/src/parse/tests.rs 3 - assertion_line: 527 4 - expression: "pub const x = <<<<>>:binary>>" 5 - --- 6 - 7 - warning: Deprecated bit literal option 8 - ┌─ :1:22 9 - 10 - 1 │ pub const x = <<<<>>:binary>> 11 - │ ^^^^^^ 12 - 13 - This option has been replaced by the `bytes` option. 14 - 15 - Hint: Run `gleam format` to auto-fix your code. 16 -
-16
compiler-core/src/parse/snapshots/gleam_core__parse__tests__deprecated_option_binary_expression.snap
··· 1 - --- 2 - source: compiler-core/src/parse/tests.rs 3 - assertion_line: 532 4 - expression: "pub fn main(x) {\n <<x:binary>>\n}" 5 - --- 6 - 7 - warning: Deprecated bit literal option 8 - ┌─ :2:7 9 - 10 - 2 │ <<x:binary>> 11 - │ ^^^^^^ 12 - 13 - This option has been replaced by the `bytes` option. 14 - 15 - Hint: Run `gleam format` to auto-fix your code. 16 -
-16
compiler-core/src/parse/snapshots/gleam_core__parse__tests__deprecated_option_binary_pattern.snap
··· 1 - --- 2 - source: compiler-core/src/parse/tests.rs 3 - assertion_line: 541 4 - expression: "pub fn main(x) {\n let assert <<y:binary>> = x\n y\n}" 5 - --- 6 - 7 - warning: Deprecated bit literal option 8 - ┌─ :2:18 9 - 10 - 2 │ let assert <<y:binary>> = x 11 - │ ^^^^^^ 12 - 13 - This option has been replaced by the `bytes` option. 14 - 15 - Hint: Run `gleam format` to auto-fix your code. 16 -
-16
compiler-core/src/parse/snapshots/gleam_core__parse__tests__deprecated_option_bit_string_const.snap
··· 1 - --- 2 - source: compiler-core/src/parse/tests.rs 3 - assertion_line: 503 4 - expression: "pub const x = <<<<>>:bits>>" 5 - --- 6 - 7 - warning: Deprecated bit literal option 8 - ┌─ :1:22 9 - 10 - 1 │ pub const x = <<<<>>:bits>> 11 - │ ^^^^^^^^^^ 12 - 13 - This option has been replaced by the `bits` option. 14 - 15 - Hint: Run `gleam format` to auto-fix your code. 16 -
-16
compiler-core/src/parse/snapshots/gleam_core__parse__tests__deprecated_option_bit_string_expression.snap
··· 1 - --- 2 - source: compiler-core/src/parse/tests.rs 3 - assertion_line: 508 4 - expression: "pub fn main(x) {\n <<x:bits>>\n}" 5 - --- 6 - 7 - warning: Deprecated bit literal option 8 - ┌─ :2:7 9 - 10 - 2 │ <<x:bits>> 11 - │ ^^^^^^^^^^ 12 - 13 - This option has been replaced by the `bits` option. 14 - 15 - Hint: Run `gleam format` to auto-fix your code. 16 -
-16
compiler-core/src/parse/snapshots/gleam_core__parse__tests__deprecated_option_bit_string_pattern.snap
··· 1 - --- 2 - source: compiler-core/src/parse/tests.rs 3 - assertion_line: 517 4 - expression: "pub fn main(x) {\n let assert <<y:bits>> = x\n y\n}" 5 - --- 6 - 7 - warning: Deprecated bit literal option 8 - ┌─ :2:18 9 - 10 - 2 │ let assert <<y:bits>> = x 11 - │ ^^^^^^^^^^ 12 - 13 - This option has been replaced by the `bits` option. 14 - 15 - Hint: Run `gleam format` to auto-fix your code. 16 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__discard_left_hand_side_of_concat_pattern.snap
··· 13 13 14 14 If you want to match one character consider using `pop_grapheme` 15 15 from the stdlib's `gleam/string` module. 16 -
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__external_attribute_with_non_fn_definition.snap
··· 7 7 8 8 2 │ @external(erlang, "module", "fun") 9 9 │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I was expecting a function definition after this 10 - 11 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__import_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 646 4 3 expression: "import wibble.{type Wobble, Wobble, type Wabble}" 5 4 --- 6 5 Parsed {
-3
compiler-core/src/parse/snapshots/gleam_core__parse__tests__incomplete_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 485 4 3 expression: fn() 5 4 --- 6 5 error: Syntax error ··· 8 7 9 8 1 │ fn() 10 9 │ ^^^^ This function does not have a body 11 - 12 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__list_spread_followed_by_extra_items.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 718 4 3 expression: "\npub fn main() -> Nil {\n let xs = [1, 2, 3]\n [1, 2, ..xs, 3 + 3, 4]\n}\n" 5 4 --- 6 5 error: Syntax error
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__multiple_deprecation_attributes.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 490 4 3 expression: "\n@deprecated(\"1\")\n@deprecated(\"2\")\npub fn main() -> Nil {\n Nil\n}\n" 5 4 --- 6 5 error: Syntax error ··· 10 9 │ ^^^^^^^^^^^ Duplicate attribute 11 10 12 11 This attribute has already been given. 13 -
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__multiple_external_for_same_project_erlang.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 451 4 3 expression: "\n@external(erlang, \"one\", \"two\")\n@external(erlang, \"three\", \"four\")\npub fn one(x: Int) -> Int {\n todo\n}\n" 5 4 --- 6 5 error: Syntax error ··· 10 9 │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Duplicate attribute 11 10 12 11 This attribute has already been given. 13 -
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__multiple_external_for_same_project_javascript.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 464 4 3 expression: "\n@external(javascript, \"one\", \"two\")\n@external(javascript, \"three\", \"four\")\npub fn one(x: Int) -> Int {\n todo\n}\n" 5 4 --- 6 5 error: Syntax error ··· 10 9 │ ^^^^^^^^^ Duplicate attribute 11 10 12 11 This attribute has already been given. 13 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__multiple_internal_attributes.snap
··· 9 9 │ ^^^^^^^^^ Duplicate attribute 10 10 11 11 This attribute has already been given. 12 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__nested_block.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 435 4 3 expression: "{ 1 { 1.0 2.0 } 3 }" 5 4 --- 6 5 [
-3
compiler-core/src/parse/snapshots/gleam_core__parse__tests__no_eq_after_binding_snapshot_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 371 4 3 expression: let foo 5 4 --- 6 5 error: Syntax error ··· 8 7 9 8 1 │ let foo 10 9 │ ^^^ I was expecting a '=' after this 11 - 12 -
-3
compiler-core/src/parse/snapshots/gleam_core__parse__tests__no_eq_after_binding_snapshot_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 375 4 3 expression: "let foo\n foo = 4" 5 4 --- 6 5 error: Syntax error ··· 8 7 9 8 1 │ let foo 10 9 │ ^^^ I was expecting a '=' after this 11 - 12 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__no_let_binding_snapshot_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 466 4 3 expression: foo = 4 5 4 --- 6 5 error: Syntax error
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__no_let_binding_snapshot_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 471 4 3 expression: "foo:Int = 4" 5 4 --- 6 5 error: Syntax error
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__no_let_binding_snapshot_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 476 4 3 expression: "let bar:Int = 32\n bar = 42" 5 4 --- 6 5 error: Syntax error
-17
compiler-core/src/parse/snapshots/gleam_core__parse__tests__reserved_peek.snap
··· 1 - --- 2 - source: compiler-core/src/parse/tests.rs 3 - assertion_line: 706 4 - expression: const echo = 1 5 - --- 6 - 7 - warning: Reserved word used 8 - ┌─ :1:7 9 - 10 - 1 │ const echo = 1 11 - │ ^^^^ 12 - 13 - The word `echo` has been reserved for future use. 14 - 15 - If you do not rename this then your code may stop working in 16 - a future version of Gleam. 17 -
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__semicolons.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 412 4 3 expression: "{ 2 + 3; - -5; }" 5 4 --- 6 5 error: Syntax error ··· 11 10 12 11 Hint: Semicolons used to be whitespace and did nothing. 13 12 You can safely remove them without your program changing. 14 -
-1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__string_single_char_suggestion.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 782 4 3 expression: "\n pub fn main() {\n let a = 'example'\n }\n " 5 4 --- 6 5 error: Syntax error
+1 -1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__type_invalid_constructor.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - expression: "\ntype A { \n A(String)\n type\n}\n" 3 + expression: "\ntype A {\n A(String)\n type\n}\n" 4 4 --- 5 5 error: Syntax error 6 6 ┌─ /src/parse/error.gleam:4:5
+1 -1
compiler-core/src/parse/snapshots/gleam_core__parse__tests__type_invalid_constructor_arg.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - expression: "\ntype A { \n A(type: String)\n}\n" 3 + expression: "\ntype A {\n A(type: String)\n}\n" 4 4 --- 5 5 error: Syntax error 6 6 ┌─ /src/parse/error.gleam:3:7
-2
compiler-core/src/parse/snapshots/gleam_core__parse__tests__unknown_attribute.snap
··· 1 1 --- 2 2 source: compiler-core/src/parse/tests.rs 3 - assertion_line: 484 4 3 expression: "@go_faster()\npub fn main() { 1 }" 5 4 --- 6 5 error: Syntax error ··· 10 9 │ ^^^^^^^^^^ I don't recognise this attribute 11 10 12 11 Try `deprecated`, `external` or `target` instead. 13 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__erlang_only_function_used_by_javascript_module.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@external(erlang, \"foo\", \"bar\")\npub fn erlang_only() -> Int\n\npub fn main() {\n erlang_only()\n}\n" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:5:3 7 - 8 - 5 │ erlang_only() 9 - │ ^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the JavaScript target. 13 -
-12
compiler-core/src/type_/snapshots/gleam_core__type___tests__erlang_only_function_with_erlang_external-2.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@external(erlang, \"foo\", \"bar\")\npub fn erlang_only() -> Int\n\n@external(erlang, \"foo\", \"bar\")\npub fn uh_oh() -> Int {\n erlang_only()\n}\n" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:6:3 7 - 8 - 6 │ erlang_only() 9 - │ ^^^^^^^^^^^ 10 - 11 - This function doesn't have an implementation for the JavaScript target. 12 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__erlang_only_function_with_erlang_external.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@external(erlang, \"foo\", \"bar\")\npub fn erlang_only() -> Int\n\n@external(erlang, \"foo\", \"bar\")\npub fn uh_oh() -> Int {\n erlang_only()\n}\n" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:6:3 7 - 8 - 6 │ erlang_only() 9 - │ ^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the JavaScript target. 13 -
-12
compiler-core/src/type_/snapshots/gleam_core__type___tests__erlang_only_function_with_javascript_external.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "\n@external(erlang, \"foo\", \"bar\")\npub fn erlang_only() -> Int\n\n@external(javascript, \"foo\", \"bar\")\npub fn all_targets() -> Int {\n erlang_only()\n}\n\npub fn main() {\n all_targets()\n}\n " 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:7:3 7 - 8 - 7 │ erlang_only() 9 - │ ^^^^^^^^^^^ 10 - 11 - This function doesn't have an implementation for the JavaScript target. 12 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__erlang_targeted_function_cant_contain_javascript_only_function.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@target(erlang)\npub fn erlang_only() -> Int {\n javascript_only()\n}\n\n@external(javascript, \"foo\", \"bar\")\npub fn javascript_only() -> Int\n " 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:3:3 7 - 8 - 3 │ javascript_only() 9 - │ ^^^^^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the Erlang target. 13 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__imported_javascript_only_function.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "import module\npub fn main() {\n module.javascript_only()\n}" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:3:9 7 - 8 - 3 │ module.javascript_only() 9 - │ ^^^^^^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the Erlang target. 13 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__javascript_only_constant.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "import module\npub fn main() {\n module.javascript_only_constant()\n}" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:3:9 7 - 8 - 3 │ module.javascript_only_constant() 9 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the Erlang target. 13 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__javascript_only_function_used_by_erlang_module.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@external(javascript, \"foo\", \"bar\")\npub fn js_only() -> Int\n\npub fn main() {\n js_only()\n}\n" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:5:3 7 - 8 - 5 │ js_only() 9 - │ ^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the Erlang target. 13 -
-12
compiler-core/src/type_/snapshots/gleam_core__type___tests__javascript_only_function_with_javascript_external-2.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@external(javascript, \"foo\", \"bar\")\npub fn javascript_only() -> Int\n\n@external(javascript, \"foo\", \"bar\")\npub fn uh_oh() -> Int {\n javascript_only()\n}\n" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:6:3 7 - 8 - 6 │ javascript_only() 9 - │ ^^^^^^^^^^^^^^^ 10 - 11 - This function doesn't have an implementation for the Erlang target. 12 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__javascript_only_function_with_javascript_external.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@external(javascript, \"foo\", \"bar\")\npub fn javascript_only() -> Int\n\n@external(javascript, \"foo\", \"bar\")\npub fn uh_oh() -> Int {\n javascript_only()\n}\n" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:6:3 7 - 8 - 6 │ javascript_only() 9 - │ ^^^^^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the Erlang target. 13 -
-13
compiler-core/src/type_/snapshots/gleam_core__type___tests__javascript_targeted_function_cant_contain_erlang_only_function.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests.rs 3 - expression: "@target(javascript)\npub fn javascript_only() -> Int {\n erlang_only()\n}\n\n@external(erlang, \"foo\", \"bar\")\npub fn erlang_only() -> Int\n " 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:3:3 7 - 8 - 3 │ erlang_only() 9 - │ ^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the JavaScript target. 13 -
-3
compiler-core/src/type_/snapshots/gleam_core__type___tests__string_concat_ko_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests.rs 3 - assertion_line: 1723 4 3 expression: " \"1\" <> 2 " 5 4 --- 6 5 error: Type mismatch ··· 16 15 But this argument has this type: 17 16 18 17 Int 19 - 20 -
-3
compiler-core/src/type_/snapshots/gleam_core__type___tests__string_concat_ko_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests.rs 3 - assertion_line: 1728 4 3 expression: " 1 <> \"2\" " 5 4 --- 6 5 error: Type mismatch ··· 16 15 But this argument has this type: 17 16 18 17 Int 19 - 20 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__custom_types__deprecated_type.snap
··· 2 2 source: compiler-core/src/type_/tests/custom_types.rs 3 3 expression: "\n@deprecated(\"Dont use this!\")\npub type Cat {\n Cat(name: String, cuteness: Int)\n}\n\npub fn name() -> String {\n let c = Cat(\"Numi\", 20)\n c.name\n}\n " 4 4 --- 5 - 6 5 warning: Deprecated value used 7 6 ┌─ /src/warning/wrn.gleam:8:11 8 7 ··· 10 9 │ ^^^ This value has been deprecated 11 10 12 11 It was deprecated with this message: Dont use this! 13 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__custom_types__duplicate_variable_error_does_not_stop_analysis.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/custom_types.rs 3 - assertion_line: 50 4 3 expression: "\ntype Two(a, a) {\n Two(a, a)\n}\n\ntype Three(a, a) {\n Three\n}\n" 5 4 --- 6 5 error: Duplicate type parameter
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__custom_types__fault_tolerance.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/custom_types.rs 3 - assertion_line: 36 4 3 expression: "\npub type Cat {\n Cat(UnknownType)\n}\n\npub type Kitten = AnotherUnknownType\n " 5 4 --- 6 5 error: Unknown type
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__access_int.snap
··· 13 13 Int 14 14 15 15 It does not have any fields. 16 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__add_f_int_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 206 4 3 expression: 1 +. 1.0 5 4 --- 6 5 error: Type mismatch ··· 18 17 Int 19 18 20 19 Hint: the + operator can be used with Ints 21 - 22 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__add_int_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 201 4 3 expression: 1 + 1.0 5 4 --- 6 5 error: Type mismatch ··· 18 17 Float 19 18 20 19 Hint: the +. operator can be used with Floats 21 - 22 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__ambiguous_import_error_no_unqualified.snap
··· 12 12 13 13 `sub` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__ambiguous_import_error_with_unqualified.snap
··· 12 12 13 13 `sub` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__ambiguous_type_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1606 4 3 expression: "import foo pub type Thing { Thing }\n pub fn main() {\n [Thing] == [foo.Thing]\n }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(foo.Thing) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__assigned_function_annotation.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 286 4 3 expression: "let f = fn(x: Int) { x } f(1.0)" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 34 4 3 expression: "case <<1>> { <<2.0, a>> -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_binary.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 44 4 3 expression: "case <<1>> { <<a:bytes>> if a > 1 -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 BitArray 19 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_bits_option_in_value.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 195 4 3 expression: "let x = <<<<1:1>>:bytes>> x" 5 4 --- 6 5 error: Invalid bit array segment
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 39 4 3 expression: "case <<1>> { <<a:float>> if a > 1 -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_float_size.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 190 4 3 expression: "let x = <<1:8-float>> x" 5 4 --- 6 5 error: Invalid bit array segment
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_guard.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 49 4 3 expression: "case <<1>> { <<a:utf16_codepoint>> if a == \"test\" -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_invalid_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 7 4 3 expression: "fn x() { \"test\" }\n\nfn main() {\n let a = <<1:size(x())>>\n a\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_conflicting_endianness1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 89 4 3 expression: "let x = <<1:big-little>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_conflicting_endianness2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 94 4 3 expression: "case <<1>> { <<1:native-big>> -> 1 }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_conflicting_options_bit_array.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 74 4 3 expression: "case <<1>> { <<1:bits-bytes>> -> 1 }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_conflicting_options_int.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 69 4 3 expression: "let x = <<1:int-bytes>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_conflicting_signedness1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 79 4 3 expression: "let x = <<1:signed-unsigned>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_conflicting_signedness2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 84 4 3 expression: "case <<1>> { <<1:unsigned-signed>> -> 1 }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_nosize.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 54 4 3 expression: "case <<1>> { <<_:bytes, _:bytes>> -> 1 }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_nosize2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 59 4 3 expression: "case <<1>> { <<_:bits, _:bytes>> -> 1 }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_nosize3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 64 4 3 expression: "case <<1>> { <<_:bytes, _:bits>> -> 1 }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_size.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 99 4 3 expression: "let x = <<1:8-size(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_size2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 104 4 3 expression: "case <<1>> { <<1:size(2)-size(8)>> -> a }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_size_utf16.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 164 4 3 expression: "let x = <<1:utf16-size(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_size_utf32.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 169 4 3 expression: "case <<1>> { <<1:utf32-size(5)>> -> a }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_size_utf8.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 159 4 3 expression: "let x = <<1:utf8-size(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_codepoint_utf16.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 119 4 3 expression: "let x = <<1:utf16_codepoint-unit(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_codepoint_utf16_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 134 4 3 expression: "let x = <<1:utf16_codepoint-size(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_codepoint_utf32.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 124 4 3 expression: "case <<1>> { <<1:utf32_codepoint-unit(2)>> -> a }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_codepoint_utf32_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 139 4 3 expression: "case <<1>> { <<1:utf32_codepoint-size(5)>> -> a }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_codepoint_utf8.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 114 4 3 expression: "let x = <<1:utf8_codepoint-unit(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_codepoint_utf8_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 129 4 3 expression: "let x = <<1:utf8_codepoint-size(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_utf16.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 149 4 3 expression: "let x = <<1:utf16-unit(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_utf32.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 154 4 3 expression: "case <<1>> { <<1:utf32-unit(2)>> -> a }" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_type_does_not_allow_unit_utf8_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 144 4 3 expression: "let x = <<1:utf8-unit(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_unit_no_size.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 174 4 3 expression: "let x = <<1:unit(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_segment_unit_unit.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 109 4 3 expression: "let x = <<1:unit(2)-unit(5)>> x" 5 4 --- 6 5 error: Invalid bit array segment
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_size_not_int.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 179 4 3 expression: "let x = <<1:size(\"1\")>> x" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_array_size_not_int_variable.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 184 4 3 expression: "let a = 2.0 case <<1>> { <<1:size(a)>> -> a }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_arrays2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 19 4 3 expression: "let <<x:utf8>> = <<1>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_arrays3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 24 4 3 expression: "let <<x:utf16>> = <<1>> x" 5 4 --- 6 5 error: Invalid bit array segment
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_arrays4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 29 4 3 expression: "let <<x:utf32>> = <<1>> x" 5 4 --- 6 5 error: Invalid bit array segment
-19
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_string.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 34 4 - expression: "case <<1>> { <<2.0, a>> -> 1 }" 5 - --- 6 - error: Type mismatch 7 - ┌─ /src/one/two.gleam:1:16 8 - 9 - 1 │ case <<1>> { <<2.0, a>> -> 1 } 10 - │ ^^^ 11 - 12 - Expected type: 13 - 14 - Int 15 - 16 - Found type: 17 - 18 - Float 19 -
-19
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_string_binary.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 44 4 - expression: "case <<1>> { <<a:bytes>> if a > 1 -> 1 }" 5 - --- 6 - error: Type mismatch 7 - ┌─ /src/one/two.gleam:1:29 8 - 9 - 1 │ case <<1>> { <<a:bytes>> if a > 1 -> 1 } 10 - │ ^ 11 - 12 - Expected type: 13 - 14 - Int 15 - 16 - Found type: 17 - 18 - BitArray 19 -
-19
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_string_float.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 39 4 - expression: "case <<1>> { <<a:float>> if a > 1 -> 1 }" 5 - --- 6 - error: Type mismatch 7 - ┌─ /src/one/two.gleam:1:29 8 - 9 - 1 │ case <<1>> { <<a:float>> if a > 1 -> 1 } 10 - │ ^ 11 - 12 - Expected type: 13 - 14 - Int 15 - 16 - Found type: 17 - 18 - Float 19 -
-19
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_string_guard.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 49 4 - expression: "case <<1>> { <<a:utf16_codepoint>> if a == \"test\" -> 1 }" 5 - --- 6 - error: Type mismatch 7 - ┌─ /src/one/two.gleam:1:39 8 - 9 - 1 │ case <<1>> { <<a:utf16_codepoint>> if a == "test" -> 1 } 10 - │ ^^^^^^^^^^^ 11 - 12 - Expected type: 13 - 14 - UtfCodepoint 15 - 16 - Found type: 17 - 18 - String 19 -
-19
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_string_invalid_type.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 7 4 - expression: "fn x() { \"test\" }\n\nfn main() {\n let a = <<1:size(x())>>\n a\n}" 5 - --- 6 - error: Type mismatch 7 - ┌─ /src/one/two.gleam:4:22 8 - 9 - 4 │ let a = <<1:size(x())>> 10 - │ ^^^ 11 - 12 - Expected type: 13 - 14 - Int 15 - 16 - Found type: 17 - 18 - String 19 -
-19
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_string_size_not_int.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 179 4 - expression: "let x = <<1:size(\"1\")>> x" 5 - --- 6 - error: Type mismatch 7 - ┌─ /src/one/two.gleam:1:18 8 - 9 - 1 │ let x = <<1:size("1")>> x 10 - │ ^^^ 11 - 12 - Expected type: 13 - 14 - Int 15 - 16 - Found type: 17 - 18 - String 19 -
-19
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__bit_string_size_not_int_variable.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 184 4 - expression: "let a = 2.0 case <<1>> { <<1:size(a)>> -> a }" 5 - --- 6 - error: Type mismatch 7 - ┌─ /src/one/two.gleam:1:35 8 - 9 - 1 │ let a = 2.0 case <<1>> { <<1:size(a)>> -> a } 10 - │ ^ 11 - 12 - Expected type: 13 - 14 - Int 15 - 16 - Found type: 17 - 18 - Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 418 4 3 expression: "case #(1, 1.0) { #(x, _) | #(_, x) -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case10.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 463 4 3 expression: "case [3], 1.1 { x, y if x >. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case11.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 468 4 3 expression: "case 2.22, 1, \"three\" { x, _, y if x >. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case12.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 473 4 3 expression: "case [3], 1.1 { x, y if x >=. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case13.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 478 4 3 expression: "case 2.22, 1, \"three\" { x, _, y if x >=. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case14.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 483 4 3 expression: "case [3], 1.1 { x, y if x <. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case15.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 488 4 3 expression: "case 2.22, 1, \"three\" { x, _, y if x <. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case16.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 493 4 3 expression: "case [3], 1.1 { x, y if x <=. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case17.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 498 4 3 expression: "case 2.22, 1, \"three\" { x, _, y if x <=. y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case18.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 503 4 3 expression: "case 1 { x if x == \"x\" -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case19.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 508 4 3 expression: "case [1] { [x] | x -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 423 4 3 expression: "case [3.33], 1 { x, y if x > y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case20.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 513 4 3 expression: "case [1] { [x] | [] as x -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 428 4 3 expression: "case 1, 2.22, \"three\" { x, _, y if x > y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 433 4 3 expression: "case [3.33], 1 { x, y if x >= y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case5.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 438 4 3 expression: "case 1, 2.22, \"three\" { x, _, y if x >= y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case6.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 443 4 3 expression: "case [3.33], 1 { x, y if x < y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case7.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 448 4 3 expression: "case 1, 2.22, \"three\" { x, _, y if x < y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case8.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 453 4 3 expression: "case [3.33], 1 { x, y if x <= y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case9.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 458 4 3 expression: "case 1, 2.22, \"three\" { x, _, y if x <= y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_clause_mismatch.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 261 4 3 expression: "case 1 { a -> 1 b -> 2.0 }" 5 4 --- 6 5 error: Type mismatch ··· 19 18 Found type: 20 19 21 20 Float 22 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_clause_pipe_diagnostic.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1413 4 3 expression: "\npub fn change(x: String) -> String {\n \"\"\n}\n\npub fn parse(input: BitArray) -> String {\n case input {\n <<>> -> 1\n <<\"(\":utf8, b:bytes>> ->\n parse(input)\n |> change\n }\n}" 5 4 --- 6 5 error: Type mismatch ··· 21 20 Found type: 22 21 23 22 String 24 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_could_not_unify.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 281 4 3 expression: "case 1, 2.0 { a, b -> a 1, 2 -> 0 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Int 19 -
-22
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_exhaustiveness1.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1490 4 - expression: "\npub fn main(b) {\n case b {\n True -> Nil\n }\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:3:5 8 - 9 - 3 │ ╭ case b { 10 - 4 │ │ True -> Nil 11 - 5 │ │ } 12 - │ ╰─────^ 13 - 14 - This case expression does not match all possibilities. 15 - Each constructor must have a pattern that matches it or 16 - else it could crash. 17 - 18 - These values are not matched: 19 - 20 - - False 21 - 22 -
-22
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_exhaustiveness2.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1503 4 - expression: "\npub fn main(r) {\n case r {\n Error(_) -> Nil\n }\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:3:5 8 - 9 - 3 │ ╭ case r { 10 - 4 │ │ Error(_) -> Nil 11 - 5 │ │ } 12 - │ ╰─────^ 13 - 14 - This case expression does not match all possibilities. 15 - Each constructor must have a pattern that matches it or 16 - else it could crash. 17 - 18 - These values are not matched: 19 - 20 - - Ok 21 - 22 -
-23
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_exhaustiveness3.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1516 4 - expression: "\npub type Media {\n Audio(BitArray)\n Video(BitArray)\n Text(String)\n}\npub fn main(m) {\n case m {\n Audio(_) as a -> a\n Video(_) -> m\n }\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:8:5 8 - 9 - 8 │ ╭ case m { 10 - 9 │ │ Audio(_) as a -> a 11 - 10 │ │ Video(_) -> m 12 - 11 │ │ } 13 - │ ╰─────^ 14 - 15 - This case expression does not match all possibilities. 16 - Each constructor must have a pattern that matches it or 17 - else it could crash. 18 - 19 - These values are not matched: 20 - 21 - - Text 22 - 23 -
-23
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_exhaustiveness4.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1535 4 - expression: "\npub type Media {\n Audio(BitArray)\n Video(BitArray)\n Text(String)\n}\npub fn main(m) {\n case m {\n Video(_) -> m\n }\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:8:5 8 - 9 - 8 │ ╭ case m { 10 - 9 │ │ Video(_) -> m 11 - 10 │ │ } 12 - │ ╰─────^ 13 - 14 - This case expression does not match all possibilities. 15 - Each constructor must have a pattern that matches it or 16 - else it could crash. 17 - 18 - These values are not matched: 19 - 20 - - Audio 21 - - Text 22 - 23 -
-22
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_exhaustiveness5.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1553 4 - expression: "\npub type Media {\n Audio(BitArray)\n Video(BitArray)\n Text(String)\n}\npub fn main(m) {\n case m {\n Audio(_) | Text(_) -> m\n }\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:8:5 8 - 9 - 8 │ ╭ case m { 10 - 9 │ │ Audio(_) | Text(_) -> m 11 - 10 │ │ } 12 - │ ╰─────^ 13 - 14 - This case expression does not match all possibilities. 15 - Each constructor must have a pattern that matches it or 16 - else it could crash. 17 - 18 - These values are not matched: 19 - 20 - - Video 21 - 22 -
-24
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_exhaustiveness6.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1571 4 - expression: "\npub fn main(b) {\n case b {\n b if b == True -> Nil\n b if b != True -> Nil\n }\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:3:5 8 - 9 - 3 │ ╭ case b { 10 - 4 │ │ b if b == True -> Nil 11 - 5 │ │ b if b != True -> Nil 12 - 6 │ │ } 13 - │ ╰─────^ 14 - 15 - This case expression does not match all possibilities. 16 - Each constructor must have a pattern that matches it or 17 - else it could crash. 18 - 19 - These values are not matched: 20 - 21 - - False 22 - - True 23 - 24 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_int_tuple_guard.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 353 4 3 expression: "case 1 { x if x == #() -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #() 19 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_operator_unify_situation.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 276 4 3 expression: "case 1, 2.0 { a, b -> a + b }" 5 4 --- 6 5 error: Type mismatch ··· 18 17 Float 19 18 20 19 Hint: the +. operator can be used with Floats 21 - 22 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_subject_pattern_unify.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 266 4 3 expression: "case 1.0 { 1 -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Int 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_subject_pattern_unify_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 271 4 3 expression: "case 1 { 1.0 -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_tuple_guard.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 338 4 3 expression: "case #(1, 2, 3) { x if x == #(1, 1.0) -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(Int, Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__case_tuple_guard_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 348 4 3 expression: "case #(1, 2) { x if x == #(1, 1.0) -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(Int, Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__const_annotation_wrong.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1141 4 3 expression: "pub const group_id: Int = \"42\"" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__const_annotation_wrong_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1146 4 3 expression: "pub const numbers: List(Int) = [1, 2, 2.3]" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__const_annotation_wrong_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1151 4 3 expression: "pub const numbers: List(Int) = [1.1, 2.2, 3.3]" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__const_annotation_wrong_4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1156 4 3 expression: "pub const pair: #(Int, Float) = #(4.1, 1)" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(Float, Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__const_heterogenus_list.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1169 4 3 expression: "const pair = [1, 1.0]" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__const_usage_wrong.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1161 4 3 expression: "const pair = #(1, 2.0)\nfn main() { 1 == pair }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(Int, Float) 19 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__correct_pipe_arity_error_location.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1133 4 3 expression: "fn x(x, y) { x }\nfn main() { 1 |> x() }" 5 4 --- 6 5 error: Incorrect arity ··· 8 7 9 8 2 │ fn main() { 1 |> x() } 10 9 │ ^^^ Expected 2 arguments, got 0 11 - 12 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__custom_type_module_constants.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1174 4 3 expression: "type X { X }\nconst x = unknown.X" 5 4 --- 6 5 error: Unknown module ··· 10 9 │ ^^^^^^^^^ 11 10 12 11 No module has been found with the name `unknown`. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_alias_names.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1014 4 3 expression: type X = Int type X = Int 5 4 --- 6 5 error: Duplicate type definition ··· 13 12 14 13 The type `X` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_anon_function_arguments.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1872 4 3 expression: "\nfn(x, x) {\n Nil\n}\n" 5 4 --- 6 5 error: Argument name already used ··· 10 9 │ ^ 11 10 12 11 Two `x` arguments have been defined for this function. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_const_and_function_names_const_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1036 4 3 expression: "const duplicate = 1\nfn duplicate() { 2 }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `duplicate` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_const_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1044 4 3 expression: "const foo = 1\nconst foo = 2" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `foo` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_const_extfn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1094 4 3 expression: "const foo = 1\n\n@external(erlang, \"module2\", \"function2\")\nfn foo() -> Float\n" 5 4 --- 6 5 error: Duplicate definition ··· 14 13 15 14 `foo` has been defined multiple times. 16 15 Names in a Gleam module must be unique so one will need to be renamed. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_const_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1116 4 3 expression: "const foo = 1\nfn foo() { 2 }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `foo` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_const_names.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1026 4 3 expression: "const duplicate = 1\npub const duplicate = 1" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `duplicate` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_constructors.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 990 4 3 expression: "type Box { Box(x: Int) }\ntype Boxy { Box(Int) }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `Box` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_constructors2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 999 4 3 expression: "type Boxy { Box(Int) }\ntype Box { Box(x: Int) }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `Box` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_constructors3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1008 4 3 expression: "type Boxy { Box(Int) Box(Float) }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `Box` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_custom_type_names.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1020 4 3 expression: "type DupType { A } type DupType { B }" 5 4 --- 6 5 error: Duplicate type definition ··· 13 12 14 13 The type `DupType` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_extfn_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1105 4 3 expression: "\n@external(erlang, \"module1\", \"function1\")\nfn foo() -> Float\n\nconst foo = 2" 5 4 --- 6 5 error: Duplicate definition ··· 14 13 15 14 `foo` has been defined multiple times. 16 15 Names in a Gleam module must be unique so one will need to be renamed. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_extfn_extfn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1060 4 3 expression: "\n@external(erlang, \"module1\", \"function1\")\nfn foo() -> Float\n@external(erlang, \"module2\", \"function2\")\nfn foo() -> Float\n" 5 4 --- 6 5 error: Duplicate definition ··· 14 13 15 14 `foo` has been defined multiple times. 16 15 Names in a Gleam module must be unique so one will need to be renamed. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_extfn_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1072 4 3 expression: "\n@external(erlang, \"module1\", \"function1\")\nfn foo() -> Float\n\nfn foo() { 2 }" 5 4 --- 6 5 error: Duplicate definition ··· 14 13 15 14 `foo` has been defined multiple times. 16 15 Names in a Gleam module must be unique so one will need to be renamed. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_fn_const.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1124 4 3 expression: "fn foo() { 1 }\nconst foo = 2" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `foo` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_fn_extfn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1083 4 3 expression: "fn foo() { 1 }\n\n@external(erlang, \"module2\", \"function2\")\nfn foo() -> Float\n" 5 4 --- 6 5 error: Duplicate definition ··· 14 13 15 14 `foo` has been defined multiple times. 16 15 Names in a Gleam module must be unique so one will need to be renamed. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_fn_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1052 4 3 expression: "fn foo() { 1 }\nfn foo() { 2 }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `foo` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_function_names.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 942 4 3 expression: "fn dupe() { 1 }\nfn dupe() { 2 }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `dupe` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_function_names_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 952 4 3 expression: "fn dupe() { 1 }\nfn dupe() { 2.0 }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `dupe` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_function_names_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 960 4 3 expression: "fn dupe() { 1 }\nfn dupe(x) { x }" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `dupe` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_function_names_4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 968 4 3 expression: "fn dupe() { 1 }\n@external(erlang, \"a\", \"b\")\nfn dupe(x) -> x\n" 5 4 --- 6 5 error: Duplicate definition ··· 14 13 15 14 `dupe` has been defined multiple times. 16 15 Names in a Gleam module must be unique so one will need to be renamed. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_function_names_5.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 978 4 3 expression: "\n@external(erlang, \"a\", \"b\")\nfn dupe(x) -> x\nfn dupe() { 1 }\n" 5 4 --- 6 5 error: Duplicate definition ··· 13 12 14 13 `dupe` has been defined multiple times. 15 14 Names in a Gleam module must be unique so one will need to be renamed. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_module_function_arguments.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1861 4 3 expression: "\npub fn main(x, x) {\n Nil\n}\n" 5 4 --- 6 5 error: Argument name already used ··· 10 9 │ ^ 11 10 12 11 Two `x` arguments have been defined for this function. 13 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_var_in_record_pattern.snap
··· 13 13 If you used the same variable twice deliberately in order to check for 14 14 equality please use a guard clause instead. 15 15 e.g. (x, y) if x == y -> ... 16 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_vars.snap
··· 13 13 If you used the same variable twice deliberately in order to check for 14 14 equality please use a guard clause instead. 15 15 e.g. (x, y) if x == y -> ... 16 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_vars_2.snap
··· 13 13 If you used the same variable twice deliberately in order to check for 14 14 equality please use a guard clause instead. 15 15 e.g. (x, y) if x == y -> ... 16 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__duplicate_vars_3.snap
··· 13 13 If you used the same variable twice deliberately in order to check for 14 14 equality please use a guard clause instead. 15 15 e.g. (x, y) if x == y -> ... 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__expression_constructor_update.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1316 4 3 expression: "\npub type Person {\n Person(name: String, age: Int)\n}\npub fn update_person(person: Person) {\n let constructor = Person\n constructor(..person)\n}" 5 4 --- 6 5 error: Invalid record constructor ··· 10 9 │ ^^^^^^^^^^^ This is not a record constructor 11 10 12 11 Only record constructors can be used with the update syntax. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__extra_var_inalternative.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 518 4 3 expression: "case [1] { [x] | [x, y] -> 1 }" 5 4 --- 6 5 error: Extra alternative pattern variable ··· 11 10 12 11 All alternative patterns must define the same variables as the initial 13 12 pattern. This variable `y` has not been previously defined. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__extra_var_inalternative2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 523 4 3 expression: "case #(1, 2) { #(1, y) | #(x, y) -> 1 }" 5 4 --- 6 5 error: Extra alternative pattern variable ··· 11 10 12 11 All alternative patterns must define the same variables as the initial 13 12 pattern. This variable `x` has not been previously defined. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__extra_var_inalternative3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 528 4 3 expression: "let x = 1 case #(1, 2) { #(1, y) | #(x, y) -> 1 }" 5 4 --- 6 5 error: Extra alternative pattern variable ··· 11 10 12 11 All alternative patterns must define the same variables as the initial 13 12 pattern. This variable `x` has not been previously defined. 14 -
+1 -1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__field_type_different_between_variants.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - expression: "\npub type Shape {\n Square(x: Int, y: Int)\n Rectangle(x: String, y: String)\n}\npub fn get_x(shape: Shape) { shape.x }\npub fn get_y(shape: Shape) { shape.y }" 3 + expression: "\npub type Shape {\n Square(x: Int, y: Int)\n Rectangle(x: String, y: String)\n}\npub fn get_x(shape: Shape) { shape.x }\n" 4 4 --- 5 5 error: Unknown record field 6 6 ┌─ /src/one/two.gleam:6:35
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__float_gtf_int.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 221 4 3 expression: 1.0 >. 1 5 4 --- 6 5 error: Type mismatch ··· 18 17 Int 19 18 20 19 Hint: the > operator can be used with Ints 21 - 22 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__fn0_eq_fn1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 226 4 3 expression: "fn() { 1 } == fn(x) { x + 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 fn(Int) -> Int 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__function_arg_and_return_annotation.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 296 4 3 expression: "fn(x: Int) -> Float { x }" 5 4 --- 6 5 error: Type mismatch ··· 19 18 Found type: 20 19 21 20 Int 22 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__function_return_annotation.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 291 4 3 expression: "fn() -> Int { 2.0 }" 5 4 --- 6 5 error: Type mismatch ··· 19 18 Found type: 20 19 21 20 Float 22 -
+1 -3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__function_return_annotation_mismatch_with_pipe.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 302 4 - expression: "pub fn main() -> String {\n 1\n |> add_two\n }\n \n fn add_two(i: Int) -> Int {\n i + 2\n }" 3 + expression: "pub fn main() -> String {\n 1\n |> add_two\n }\n\n fn add_two(i: Int) -> Int {\n i + 2\n }" 5 4 --- 6 5 error: Type mismatch 7 6 ┌─ /src/one/two.gleam:2:13 ··· 20 19 Found type: 21 20 22 21 Int 23 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__functions_called_outside_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 316 4 3 expression: "const first = list.at([1], 0)" 5 4 --- 6 5 error: Syntax error ··· 8 7 9 8 1 │ const first = list.at([1], 0) 10 9 │ ^^^^^^^^ Functions can only be called within other functions 11 - 12 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__generic_record_update1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1331 4 3 expression: "\npub type Box(a) {\n Box(value: a, i: Int)\n}\npub fn update_box(box: Box(Int), value: String) {\n Box(..box, value: value)\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__generic_record_update2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1345 4 3 expression: "\npub type Box(a) {\n Box(value: a, i: Int)\n}\npub fn update_box(box: Box(a), value: b) {\n Box(..box, value: value)\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 b 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__guard_float_int_eq_vars.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 408 4 3 expression: "let x = 1.0 let y = 1 case x { _ if x == y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Int 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__guard_if_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 413 4 3 expression: "let x = 1.0 case x { _ if x -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__guard_int_float_eq_vars.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 403 4 3 expression: "let x = 1 let y = 1.0 case x { _ if x == y -> 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__incorrect_arity_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 251 4 3 expression: "let id = fn(x) { x } id()" 5 4 --- 6 5 error: Incorrect arity ··· 8 7 9 8 1 │ let id = fn(x) { x } id() 10 9 │ ^^^^ Expected 1 argument, got 0 11 - 12 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__incorrect_arity_error_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 256 4 3 expression: "let id = fn(x) { x } id(1, 2)" 5 4 --- 6 5 error: Incorrect arity ··· 8 7 9 8 1 │ let id = fn(x) { x } id(1, 2) 10 9 │ ^^^^^^^^ Expected 1 argument, got 2 11 - 12 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__int_eq_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 211 4 3 expression: 1 == 1.0 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__int_float_list.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 398 4 3 expression: "[1.0] == [1]" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__int_gt_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 216 4 3 expression: 1 > 1.0 5 4 --- 6 5 error: Type mismatch ··· 18 17 Float 19 18 20 19 Hint: the >. operator can be used with Floats 21 - 22 -
-20
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__let_exhaustiveness1.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1432 4 - expression: "\npub fn main(b) {\n let True = b\n Nil\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:3:5 8 - 9 - 3 │ let True = b 10 - │ ^^^^^^^^^^^^ 11 - 12 - This assignment does not match all possibilities. 13 - Either use a case expression with patterns for each possible 14 - value, or use `let assert` rather than `let`. 15 - 16 - These values are not matched: 17 - 18 - - False 19 - 20 -
-20
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__let_exhaustiveness2.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1444 4 - expression: "\npub fn main(r) {\n let Error(_) = r\n Nil\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:3:5 8 - 9 - 3 │ let Error(_) = r 10 - │ ^^^^^^^^^^^^^^^^ 11 - 12 - This assignment does not match all possibilities. 13 - Either use a case expression with patterns for each possible 14 - value, or use `let assert` rather than `let`. 15 - 16 - These values are not matched: 17 - 18 - - Ok 19 - 20 -
-21
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__let_exhaustiveness3.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1456 4 - expression: "\npub type Media {\n Audio(BitArray)\n Video(BitArray)\n Text(String)\n}\npub fn main(m) {\n let Video(_) = m\n Nil\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:8:5 8 - 9 - 8 │ let Video(_) = m 10 - │ ^^^^^^^^^^^^^^^^ 11 - 12 - This assignment does not match all possibilities. 13 - Either use a case expression with patterns for each possible 14 - value, or use `let assert` rather than `let`. 15 - 16 - These values are not matched: 17 - 18 - - Audio 19 - - Text 20 - 21 -
-21
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__let_exhaustiveness4.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1473 4 - expression: "\npub type Media {\n Audio(BitArray)\n Video(BitArray)\n Text(String)\n}\npub fn main(m) {\n let Video(_) as v = m\n v\n}\n" 5 - --- 6 - error: Not exhaustive pattern match 7 - ┌─ /src/one/two.gleam:8:5 8 - 9 - 8 │ let Video(_) as v = m 10 - │ ^^^^^^^^^^^^^^^^^^^^^ 11 - 12 - This assignment does not match all possibilities. 13 - Either use a case expression with patterns for each possible 14 - value, or use `let assert` rather than `let`. 15 - 16 - These values are not matched: 17 - 18 - - Audio 19 - - Text 20 - 21 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__list.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1908 4 3 expression: "[1, 2.0]" 5 4 --- 6 5 error: Type mismatch ··· 19 18 Found type: 20 19 21 20 Float 22 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__mismatched_list_tail.snap
··· 18 18 Found type: 19 19 20 20 List(Int) 21 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__missing_variable_in_alternative_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1402 4 3 expression: "case [] { [x] | [] -> x _ -> 0 }" 5 4 --- 6 5 error: Missing alternative pattern variable ··· 11 10 12 11 All alternative patterns must define the same variables as the initial 13 12 pattern, but the `x` variable is missing. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_arity_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 759 4 3 expression: "fn go(x: List(a, b)) -> Int { 1 }" 5 4 --- 6 5 error: Incorrect arity ··· 11 10 12 11 Functions and constructors have to be called with their expected 13 12 number of arguments. 14 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 644 4 3 expression: "fn go() { 1 + 2.0 }" 5 4 --- 6 5 error: Type mismatch ··· 18 17 Float 19 18 20 19 Hint: the +. operator can be used with Floats 21 - 22 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify10.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 719 4 3 expression: "fn main() {\n let #(y, [..x]): #(x, List(x)) = #(\"one\", [1,2,3])\n x\n }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(String, List(Int)) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify11.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 729 4 3 expression: "\n pub type Box(inner) {\n Box(inner)\n }\n\n pub fn create_int_box(value: Int) {\n let x: Box(Float) = Box(value)\n x\n }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Box(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify12.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 744 4 3 expression: "\n pub type Person {\n Person(name: String, age: Int)\n }\n\n pub fn create_person(age: Float) {\n let x: Person = Person(name: \"Quinn\", age: age)\n x\n }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 649 4 3 expression: "fn go() { 1 + 2.0 }" 5 4 --- 6 5 error: Type mismatch ··· 18 17 Float 19 18 20 19 Hint: the +. operator can be used with Floats 21 - 22 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 654 4 3 expression: "\nfn id(x: a, y: a) { x }\npub fn x() { id(1, 1.0) }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 663 4 3 expression: "\nfn bar() -> Int {\n 5\n}\n\nfn run(one: fn() -> String) {\n one()\n}\n\nfn demo() {\n run(bar)\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 fn() -> Int 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify5.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 681 4 3 expression: "\nfn bar(x: Int) -> Int {\n x * 5\n}\n\nfn run(one: fn(String) -> Int) {\n one(\"one.\")\n}\n\nfn demo() {\n run(bar)\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 fn(Int) -> Int 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify6.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 699 4 3 expression: "fn main() { let x: String = 5 x }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Int 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify7.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 704 4 3 expression: "fn main() { let assert 5: Int = \"\" 5 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Int 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify8.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 709 4 3 expression: "fn main() { let x: #(x, x) = #(5, 5.0) x }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(Int, Float) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_could_not_unify9.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 714 4 3 expression: "fn main() { let [1, 2, ..x]: List(String) = [1,2,3] x }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(Int) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_non_local_gaurd_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 850 4 3 expression: "fn one() { 1 }\nfn main() { case 1 { _ if one -> 1 } }" 5 4 --- 6 5 error: Invalid guard variable ··· 11 10 12 11 Variables used in guards must be either defined in the function, or be an 13 12 argument to the function. The variable `one` is not defined locally. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_private_type_leak_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 764 4 3 expression: "type PrivateType\n\n@external(erlang, \"a\", \"b\")\npub fn leak_type() -> PrivateType\n" 5 4 --- 6 5 error: Private type used in public interface ··· 14 13 PrivateType 15 14 16 15 Private types can only be used within the module that defines them. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_private_type_leak_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 775 4 3 expression: "type PrivateType\n\n@external(erlang, \"a\", \"b\")\nfn go() -> PrivateType\n\npub fn leak_type() { go() }" 5 4 --- 6 5 error: Private type used in public interface ··· 14 13 PrivateType 15 14 16 15 Private types can only be used within the module that defines them. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_private_type_leak_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 787 4 3 expression: "type PrivateType\n@external(erlang, \"a\", \"b\")\nfn go() -> PrivateType\npub fn leak_type() { [go()] }" 5 4 --- 6 5 error: Private type used in public interface ··· 14 13 PrivateType 15 14 16 15 Private types can only be used within the module that defines them. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_private_type_leak_4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 797 4 3 expression: "type PrivateType\n@external(erlang, \"a\", \"b\")\npub fn go(x: PrivateType) -> Int" 5 4 --- 6 5 error: Private type used in public interface ··· 14 13 PrivateType 15 14 16 15 Private types can only be used within the module that defines them. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__module_private_type_leak_5.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 806 4 3 expression: "type PrivateType\npub type LeakType { Variant(PrivateType) }" 5 4 --- 6 5 error: Private type used in public interface ··· 14 13 PrivateType 15 14 16 15 Private types can only be used within the module that defines them. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__negate_boolean_as_integer.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1883 4 3 expression: "\nfn() {\n let a = True\n let b = -a\n}\n" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Bool 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__negate_float_as_integer.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1895 4 3 expression: "\nfn() {\n let a = 3.0\n let b = -a\n}\n" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Float 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__negate_string.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1601 4 3 expression: "!\"Hello Gleam\"" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 String 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__not_a_constructor_update.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1301 4 3 expression: "\npub type Person {\n Person(name: String, age: Int)\n}\npub fn identity(a) { a }\npub fn update_person(person: Person) {\n identity(..person)\n}" 5 4 --- 6 5 error: Invalid record constructor ··· 10 9 │ ^^^^^^^^ This is not a record constructor 11 10 12 11 Only record constructors can be used with the update syntax. 13 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__ok_2_args.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 373 4 3 expression: "let Ok(1, x) = 1 x" 5 4 --- 6 5 error: Incorrect arity ··· 8 7 9 8 1 │ let Ok(1, x) = 1 x 10 9 │ ^^^^^^^^ Expected 1 argument, got 2 11 - 12 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__pipe_arity_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1585 4 3 expression: "\nfn go(x, y) {\n x + y\n}\n\nfn main(x) {\n 1\n |> go\n}\n" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 fn(Int) -> a 19 -
+1 -3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__pipe_mismatch_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 321 4 - expression: "pub fn main() -> String {\n Orange\n |> eat_veggie\n }\n \n type Fruit{ Orange }\n type Veg{ Lettuce }\n \n fn eat_veggie(v: Veg) -> String {\n \"Ok\"\n }" 3 + expression: "pub fn main() -> String {\n Orange\n |> eat_veggie\n }\n\n type Fruit{ Orange }\n type Veg{ Lettuce }\n\n fn eat_veggie(v: Veg) -> String {\n \"Ok\"\n }" 5 4 --- 6 5 error: Type mismatch 7 6 ┌─ /src/one/two.gleam:3:16 ··· 16 15 But function expects: 17 16 18 17 Veg 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__positional_argument_after_labelled.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 819 4 3 expression: "type X { X(a: Int, b: Int, c: Int) }\nfn x() { X(b: 1, a: 1, 1) }" 5 4 --- 6 5 error: Unexpected positional argument ··· 12 11 This unlabeled argument has been supplied after a labelled argument. 13 12 Once a labelled argument has been supplied all following arguments must 14 13 also be labelled. 15 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__recursive_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 363 4 3 expression: "let id = fn(x) { x(x) } 1" 5 4 --- 6 5 error: Recursive type ··· 13 12 to be defined in terms of itself. 14 13 15 14 Hint: Add some type annotations and try again. 16 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__same_imports_multiple_times.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1566 4 3 expression: "\n import gleam/foo.{bar}\n import gleam/foo.{zoo}\n pub fn go() { bar() + zoo() }\n " 5 4 --- 6 5 error: Duplicate import
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__same_imports_multiple_times_1.snap
··· 12 12 13 13 `one` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__same_imports_multiple_times_2.snap
··· 12 12 13 13 `two` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__same_imports_multiple_times_3.snap
··· 12 12 13 13 `x` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__same_imports_multiple_times_4.snap
··· 12 12 13 13 `one` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__same_imports_multiple_times_5.snap
··· 12 12 13 13 `two` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__same_imports_multiple_times_6.snap
··· 12 12 13 13 `x` has been imported multiple times. 14 14 Names in a Gleam module must be unique so one will need to be renamed. 15 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__true_fn.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 368 4 3 expression: let True(x) = 1 x 5 4 --- 6 5 error: Incorrect arity ··· 8 7 9 8 1 │ let True(x) = 1 x 10 9 │ ^^^^^^^ Expected no arguments, got 1 11 - 12 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__tuple_2_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 383 4 3 expression: "#(1, 2) == #(1, 2, 3)" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(Int, Int, Int) 19 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__tuple_arity.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 534 4 3 expression: "case #(1, 2) { #(1, _, _, _) -> 1 }" 5 4 --- 6 5 error: Incorrect arity ··· 8 7 9 8 1 │ case #(1, 2) { #(1, _, _, _) -> 1 } 10 9 │ ^^^^^^^^^^^^^ Expected 2 arguments, got 4 11 - 12 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__tuple_index_not_a_tuple.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 559 4 3 expression: Nil.2 5 4 --- 6 5 error: Type mismatch ··· 12 11 To index into this value it needs to be a tuple, however it has this type: 13 12 14 13 Nil 15 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__tuple_index_not_a_tuple_unbound.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 564 4 3 expression: "fn(a) { a.2 }" 5 4 --- 6 5 error: Type mismatch ··· 12 11 To index into a tuple we need to know it size, but we don't know 13 12 anything about this type yet. Please add some type annotations so 14 13 we can continue. 15 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__tuple_index_out_of_bounds.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 554 4 3 expression: "#(0, 1).2" 5 4 --- 6 5 error: Out of bounds tuple index ··· 11 10 12 11 The index being accessed for this tuple is 2, but this tuple has 2 elements 13 12 so the highest valid index is 1. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__tuple_int.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 393 4 3 expression: "let #(a, b) = 1 a" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(a, b) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__tuple_int_float.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 388 4 3 expression: "#(1.0, 2, 3) == #(1, 2, 3)" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 #(Int, Int, Int) 19 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__type_annotations.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1407 4 3 expression: "fn inc(x: a) { x + 1 }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 But this argument has this type: 17 16 18 17 a 19 - 20 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__type_holes1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1368 4 3 expression: "type A { A(_) }" 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__type_holes2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1374 4 3 expression: "\n@external(erlang, \"a\", \"b\")\nfn main() -> List(_)\n" 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__type_holes3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1385 4 3 expression: "\n@external(erlang, \"a\", \"b\")\nfn main(x: List(_)) -> Nil\n" 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__type_holes4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1396 4 3 expression: type X = List(_) 5 4 --- 6 5 error: Unexpected type hole ··· 10 9 │ ^ I need to know what this is 11 10 12 11 We need to know the exact type here so type holes cannot be used. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__type_variables_in_body.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 926 4 3 expression: "\npub type Box(a) {\n Box(value: a)\n}\npub fn go(box1: Box(a), box2: Box(b)) {\n let _: Box(a) = box2\n let _: Box(b) = box1\n 5\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Box(b) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__type_vars_must_be_declared.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1359 4 3 expression: "type A(a) { A }\ntype B = a" 5 4 --- 6 5 error: Unknown type ··· 10 9 │ ^ Did you mean `A`? 11 10 12 11 The type `a` is not defined or imported in this module. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unexpected_labelled_arg.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 814 4 3 expression: "fn id(x) { x } fn y() { id(x: 4) }" 5 4 --- 6 5 error: Unexpected labelled argument ··· 11 10 12 11 This argument has been given a label but the constructor does 13 12 not expect any. Please remove the label `x`. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_accessed_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 569 4 3 expression: "fn(a) { a.field }" 5 4 --- 6 5 error: Unknown type for record access ··· 12 11 In order to access a record field we need to know what type it is, 13 12 but I can't tell the type here. Try adding type annotations to your 14 13 function and try again. 15 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_constructor_update.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1287 4 3 expression: "\npub type Person {\n Person(name: String, age: Int)\n}\npub fn update_person(person: Person) {\n NotAPerson(..person)\n}" 5 4 --- 6 5 error: Unknown variable ··· 10 9 │ ^^^^^^^^^^ Did you mean `Person`? 11 10 12 11 The name `NotAPerson` is not in scope here. 13 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_field.snap
··· 13 13 a 14 14 15 15 It does not have any fields. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_field_update.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1259 4 3 expression: "\n pub type Person {\n Person(name: String)\n }\n pub fn update_person(person: Person) {\n Person(..person, one: 5)\n }" 5 4 --- 6 5 error: Unknown record field ··· 16 15 It has these fields: 17 16 18 17 .name 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_imported_module_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1847 4 3 expression: "\nimport one/two\n\npub fn main(_x: two.Thing) {\n Nil\n}\n" 5 4 --- 6 5 error: Unknown module type ··· 10 9 │ ^^^^^^^^^ 11 10 12 11 The module `one/two` does not have a `Thing` type. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_label.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1182 4 3 expression: "type X { X(a: Int, b: Float) }\nfn x() {\n let x = X(a: 1, c: 2.0)\n x\n}" 5 4 --- 6 5 error: Unknown label ··· 12 11 It accepts these labels: 13 12 14 13 b 15 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 236 4 3 expression: import xpto 5 4 --- 6 5 error: Unknown module ··· 10 9 │ ^^^^^^^^^^^ 11 10 12 11 No module has been found with the name `xpto`. 13 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_record_field.snap
··· 15 15 It has these fields: 16 16 17 17 .inner 18 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_record_field_2.snap
··· 15 15 It has these fields: 16 16 17 17 .inner 18 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_type_in_alias2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 839 4 3 expression: "type IntMap = Map(Inf, Int)" 5 4 --- 6 5 error: Unknown type ··· 10 9 │ ^^^ Did you mean `Int`? 11 10 12 11 The type `Inf` is not defined or imported in this module. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_variable_update.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1245 4 3 expression: "\npub type Person {\n Person(name: String, age: Int)\n}\npub fn update_person() {\n Person(..person)\n}" 5 4 --- 6 5 error: Unknown variable ··· 10 9 │ ^^^^^^ Did you mean `Person`? 11 10 12 11 The name `person` is not in scope here. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unnecessary_spread_operator.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 879 4 3 expression: "\ntype Triple {\n Triple(a: Int, b: Int, c: Int)\n}\n\nfn main() {\n let triple = Triple(1,2,3)\n let Triple(a, b, c, ..) = triple\n a\n}" 5 4 --- 6 5 error: Unnecessary spread operator ··· 11 10 12 11 This record has 3 fields and you have already assigned variables to all 13 12 of them. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__update_multi_variant_record.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1798 4 3 expression: "\npub type Point {\n Point2(a: Int, b: Int)\n Point3(a: Int, b: Int, c: Int)\n}\n\npub fn main() {\n Point3(..Point2(a: 1, b: 2))\n}" 5 4 --- 6 5 error: Unsafe record update ··· 15 14 16 15 Consider pattern matching on it with a case expression and then 17 16 constructing a new record with its values. 18 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__wrong_number_of_subjects.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 358 4 3 expression: "case 1 { _, _ -> 1 }" 5 4 --- 6 5 error: Incorrect number of patterns ··· 11 10 12 11 This case expression has 1 subjects, but this pattern matches 2. 13 12 Each clause must have a pattern for every subject value. 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__wrong_type_arg.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1205 4 3 expression: "\nfn foo(x: List(Int)) { x }\nfn main(y: List(something)) {\n foo(y)\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 List(something) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__wrong_type_ret.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1217 4 3 expression: "pub fn main(x: something) -> Int {\n let y = x\n y\n}" 5 4 --- 6 5 error: Type mismatch ··· 19 18 Found type: 20 19 21 20 something 22 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__wrong_type_update.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1228 4 3 expression: "\n pub type Person {\n Person(name: String, age: Int)\n }\n pub type Box(a) {\n Box(a)\n }\n pub fn update_person(person: Person, box: Box(a)) {\n Person(..box)\n }" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Box(a) 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__wrong_type_var.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/errors.rs 3 - assertion_line: 1195 4 3 expression: "fn foo(x: String) { x }\nfn multi_result(x: some_name) {\n foo(x)\n}" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 some_name 19 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__bit_array_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 466 4 3 expression: "\npub fn main(x) {\n case x {\n <<>> -> 1\n <<1>> -> 1\n <<2>> -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__bit_array_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 481 4 3 expression: "\npub fn main(x) {\n case x {\n <<>> -> 1\n <<1>> -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__bool_false.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 58 4 3 expression: "\npub fn main(x) {\n case x {\n False -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__bool_true.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 45 4 3 expression: "\npub fn main(x) {\n case x {\n True -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__custom_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 781 4 3 expression: "\npub type Type {\n One\n Two\n}\n\npub fn main(x) {\n case x {\n One -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__custom_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 799 4 3 expression: "\npub type Type {\n One\n Two\n Three(Type)\n}\n\npub fn main(x) {\n case x {\n One -> 1\n Two -> 2\n Three(One) -> 4\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__discard_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 651 4 3 expression: "\npub type Thing {\n Thing(a: Bool, b: Bool)\n}\n\npub fn main(x) {\n case x {\n Thing(a: True, ..) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__discard_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 668 4 3 expression: "\npub type Thing {\n Thing(a: Bool, b: Bool)\n}\n\npub fn main(x) {\n case x {\n Thing(a: False, ..) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__discard_4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 685 4 3 expression: "\npub type Thing {\n Thing(a: Bool, b: Bool)\n}\n\npub fn main(x) {\n case x {\n Thing(a: True, ..) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__discard_5.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 702 4 3 expression: "\npub type Thing {\n Thing(a: Bool, b: Bool)\n}\n\npub fn main(x) {\n case x {\n Thing(a: False, ..) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__discard_6.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 719 4 3 expression: "\npub type Thing {\n Thing(a: Bool, b: Bool)\n}\n\npub fn main(x) {\n case x {\n Thing(False, ..) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
+1 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__empty_case_of_external.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 893 4 - expression: "\ntype Thingy\n\npub fn main(x: Thingy) {\n case x {\n }\n}\n" 3 + expression: "\npub type Thingy\n\npub fn main(x: Thingy) {\n case x {\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns 7 6 ┌─ /src/one/two.gleam:5:3
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__empty_case_of_generic.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 909 4 3 expression: "\npub fn main(x: something) {\n case x {\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__float_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 556 4 3 expression: "\npub fn main(x) {\n case x {\n 0.0 -> 1\n 1.1 -> 1\n 2.2 -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__float_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 571 4 3 expression: "\npub fn main(x) {\n case x {\n 0.0 -> 1\n 1.1 -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__guard.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 754 4 3 expression: "\npub fn main(x, y) {\n case x {\n _ if y -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__guard_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 767 4 3 expression: "\npub fn main(x, y) {\n case x {\n True if y -> 1\n False -> 2\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__int_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 511 4 3 expression: "\npub fn main(x) {\n case x {\n 0 -> 1\n 1 -> 1\n 2 -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__int_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 526 4 3 expression: "\npub fn main(x) {\n case x {\n 0 -> 1\n 1 -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__label_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 736 4 3 expression: "\npub type Thing {\n Thing(a: Bool, b: Bool)\n}\n\npub fn main(x) {\n case x {\n Thing(a: False, b: True) -> 1\n Thing(b: False, a: True) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__let_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 849 4 3 expression: "\npub fn main(x) {\n let True = x\n 0\n}\n" 5 4 --- 6 5 error: Inexhaustive pattern ··· 18 17 False 19 18 20 19 Hint: Use a more general pattern or use `let assert` instead. 21 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_bool_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 585 4 3 expression: "\npub fn main(x) {\n case x {\n [] -> 1\n [True] -> 2\n [_, _, ..] -> 2\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_bool_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 600 4 3 expression: "\npub fn main(x) {\n case x {\n [] -> 1\n [True] -> 2\n [_, False] -> 2\n [_, _, _, ..] -> 2\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_empty.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 295 4 3 expression: "\npub fn main(x) {\n case x {\n [] -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_non_empty.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 308 4 3 expression: "\npub fn main(x) {\n case x {\n [_, ..] -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_one.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 321 4 3 expression: "\npub fn main(x) {\n case x {\n [_] -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_one_two.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 334 4 3 expression: "\npub fn main(x) {\n case x {\n [_] -> 1\n [_, _] -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_zero_one_two.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 348 4 3 expression: "\npub fn main(x) {\n case x {\n [] -> 1\n [_] -> 1\n [_, _] -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__list_zero_two_any.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 379 4 3 expression: "\npub fn main(x) {\n case x {\n [] -> 1\n [_, _] -> 1\n [_, _, ..] -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__nested_type_parameter_usage.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 875 4 3 expression: "\npub type Returned(a) {\n Returned(List(a))\n}\n\nfn foo(user: Returned(#())) -> Int {\n let Returned([#()]) = user\n 1\n}\n" 5 4 --- 6 5 error: Inexhaustive pattern ··· 19 18 Returned([_, _, ..]) 20 19 21 20 Hint: Use a more general pattern or use `let assert` instead. 22 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__redundant_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 820 4 3 expression: "\npub fn main(x) {\n case x {\n _ -> 1\n _ -> 2\n }\n}\n" 5 4 --- 6 - 7 5 warning: Unreachable case clause 8 6 ┌─ /src/warning/wrn.gleam:5:5 9 7 ··· 14 12 the same values. 15 13 16 14 Hint: It can be safely removed. 17 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__redundant_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 834 4 3 expression: "\npub fn main(x) {\n case x {\n True -> 1\n False -> 2\n True -> 3\n }\n}\n" 5 4 --- 6 - 7 5 warning: Unreachable case clause 8 6 ┌─ /src/warning/wrn.gleam:6:5 9 7 ··· 14 12 the same values. 15 13 16 14 Hint: It can be safely removed. 17 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 167 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(False) -> 1\n Error(True) -> 2\n Error(False) -> 3\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 182 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(True) -> 1\n Error(True) -> 2\n Error(False) -> 3\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 197 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(True) -> 1\n Ok(False) -> 2\n Error(False) -> 3\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_4.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 212 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(True) -> 1\n Ok(False) -> 2\n Error(True) -> 3\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_5.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 227 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(True) -> 1\n Ok(False) -> 2\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_6.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 241 4 3 expression: "\npub fn main(x) {\n case x {\n Error(True) -> 1\n Error(False) -> 2\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_7.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 255 4 3 expression: "\npub fn main(x) {\n case x {\n Error(True) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_bool_8.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 268 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(False) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 98 4 3 expression: "\npub fn main(x) {\n case x {\n Error(_) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-24
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_list_empty.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 295 4 - expression: "\npub fn main(x) {\n case x {\n [] -> 1\n }\n}\n" 5 - --- 6 - 7 - warning: Inexhaustive Patterns 8 - ┌─ /src/warning/wrn.gleam:3:3 9 - 10 - 3 │ ╭ case x { 11 - 4 │ │ [] -> 1 12 - 5 │ │ } 13 - │ ╰───^ 14 - 15 - This case expression does not have a pattern for all possible values. 16 - If is run on one of the values without a pattern then it will crash. 17 - 18 - The missing patterns are: 19 - 20 - [_, ..] 21 - 22 - In a future version of Gleam this will become a compile error. 23 - 24 -
-24
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_list_non_empty.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 308 4 - expression: "\npub fn main(x) {\n case x {\n [_, ..] -> 1\n }\n}\n" 5 - --- 6 - 7 - warning: Inexhaustive Patterns 8 - ┌─ /src/warning/wrn.gleam:3:3 9 - 10 - 3 │ ╭ case x { 11 - 4 │ │ [_, ..] -> 1 12 - 5 │ │ } 13 - │ ╰───^ 14 - 15 - This case expression does not have a pattern for all possible values. 16 - If is run on one of the values without a pattern then it will crash. 17 - 18 - The missing patterns are: 19 - 20 - [] 21 - 22 - In a future version of Gleam this will become a compile error. 23 - 24 -
-25
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_list_one.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 321 4 - expression: "\npub fn main(x) {\n case x {\n [_] -> 1\n }\n}\n" 5 - --- 6 - 7 - warning: Inexhaustive Patterns 8 - ┌─ /src/warning/wrn.gleam:3:3 9 - 10 - 3 │ ╭ case x { 11 - 4 │ │ [_] -> 1 12 - 5 │ │ } 13 - │ ╰───^ 14 - 15 - This case expression does not have a pattern for all possible values. 16 - If is run on one of the values without a pattern then it will crash. 17 - 18 - The missing patterns are: 19 - 20 - [] 21 - [_, _, ..] 22 - 23 - In a future version of Gleam this will become a compile error. 24 - 25 -
-26
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_list_one_two.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 334 4 - expression: "\npub fn main(x) {\n case x {\n [_] -> 1\n [_, _] -> 1\n }\n}\n" 5 - --- 6 - 7 - warning: Inexhaustive Patterns 8 - ┌─ /src/warning/wrn.gleam:3:3 9 - 10 - 3 │ ╭ case x { 11 - 4 │ │ [_] -> 1 12 - 5 │ │ [_, _] -> 1 13 - 6 │ │ } 14 - │ ╰───^ 15 - 16 - This case expression does not have a pattern for all possible values. 17 - If is run on one of the values without a pattern then it will crash. 18 - 19 - The missing patterns are: 20 - 21 - [] 22 - [_, _, _, ..] 23 - 24 - In a future version of Gleam this will become a compile error. 25 - 26 -
-26
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_list_zero_one_two.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 348 4 - expression: "\npub fn main(x) {\n case x {\n [] -> 1\n [_] -> 1\n [_, _] -> 1\n }\n}\n" 5 - --- 6 - 7 - warning: Inexhaustive Patterns 8 - ┌─ /src/warning/wrn.gleam:3:3 9 - 10 - 3 │ ╭ case x { 11 - 4 │ │ [] -> 1 12 - 5 │ │ [_] -> 1 13 - 6 │ │ [_, _] -> 1 14 - 7 │ │ } 15 - │ ╰───^ 16 - 17 - This case expression does not have a pattern for all possible values. 18 - If is run on one of the values without a pattern then it will crash. 19 - 20 - The missing patterns are: 21 - 22 - [_, _, _, ..] 23 - 24 - In a future version of Gleam this will become a compile error. 25 - 26 -
-26
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_list_zero_two_any.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 379 4 - expression: "\npub fn main(x) {\n case x {\n [] -> 1\n [_, _] -> 1\n [_, _, ..] -> 1\n }\n}\n" 5 - --- 6 - 7 - warning: Inexhaustive Patterns 8 - ┌─ /src/warning/wrn.gleam:3:3 9 - 10 - 3 │ ╭ case x { 11 - 4 │ │ [] -> 1 12 - 5 │ │ [_, _] -> 1 13 - 6 │ │ [_, _, ..] -> 1 14 - 7 │ │ } 15 - │ ╰───^ 16 - 17 - This case expression does not have a pattern for all possible values. 18 - If is run on one of the values without a pattern then it will crash. 19 - 20 - The missing patterns are: 21 - 22 - [_] 23 - 24 - In a future version of Gleam this will become a compile error. 25 - 26 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_nil_error.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 138 4 3 expression: "\npub fn main(x) {\n case x {\n Error(Nil) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_nil_ok.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 125 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(Nil) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__result_ok.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 85 4 3 expression: "\npub fn main(x) {\n case x {\n Ok(_) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__string_1.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 410 4 3 expression: "\npub fn main(x) {\n case x {\n \"\" -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__string_2.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 423 4 3 expression: "\npub fn main(x) {\n case x {\n \"a\" -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__string_3.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 436 4 3 expression: "\npub fn main(x) {\n case x {\n \"a\" -> 1\n \"b\" -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__exhaustiveness__tuple_0.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/exhaustiveness.rs 3 - assertion_line: 861 4 3 expression: "\npub fn main(x, y) {\n case #(x, y) {\n #(True, _) -> 1\n }\n}\n" 5 4 --- 6 5 error: Inexhaustive patterns
-13
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__expression__function_with_no_valid_implementations.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/expression.rs 3 - expression: "\n@external(javascript, \"foo\", \"bar\")\npub fn javascript_only() -> Int\n \n@external(erlang, \"foo\", \"bar\")\npub fn erlang_only() -> Int\n\npub fn main() {\n javascript_only()\n erlang_only()\n}\n" 4 - --- 5 - error: Unsupported target 6 - ┌─ /src/one/two.gleam:9:5 7 - 8 - 9 │ javascript_only() 9 - │ ^^^^^^^^^^^^^^^ 10 - 11 - This value is not available as it is defined using externals, and there is 12 - no implementation for the Erlang target. 13 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__erlang_only_function_used_by_javascript_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 29 4 3 expression: "@external(erlang, \"one\", \"two\")\nfn erlang_only() -> Int\n\npub fn main() {\n erlang_only()\n}\n" 5 4 --- 6 5 error: Unsupported target
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__erlang_only_function_with_erlang_external.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 129 4 3 expression: "@external(erlang, \"one\", \"two\")\nfn erlang_only() -> Int\n\n@external(erlang, \"one\", \"two\")\npub fn uh_oh() -> Int {\n erlang_only()\n}\n" 5 4 --- 6 5 error: Unsupported target
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__erlang_targeted_function_cant_contain_javascript_only_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 144 4 3 expression: "@target(erlang)\npub fn erlang_only() -> Int {\n javascript_only()\n}\n\n@external(javascript, \"one\", \"two\")\nfn javascript_only() -> Int\n " 5 4 --- 6 5 error: Unsupported target
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__imported_javascript_only_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 163 4 3 expression: "import module\npub fn main() {\n module.javascript_only()\n}" 5 4 --- 6 5 error: Unsupported target
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__javascript_only_constant.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 178 4 3 expression: "import module\npub fn main() {\n module.javascript_only_constant()\n}" 5 4 --- 6 5 error: Unsupported target
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__javascript_only_function_used_by_erlang_module.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 16 4 3 expression: "@external(javascript, \"one\", \"two\")\nfn js_only() -> Int\n\npub fn main() {\n js_only()\n}\n" 5 4 --- 6 5 error: Unsupported target
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__javascript_only_function_with_javascript_external.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 116 4 3 expression: "@external(javascript, \"one\", \"two\")\nfn javascript_only() -> Int\n\n@external(javascript, \"one\", \"two\")\npub fn uh_oh() -> Int {\n javascript_only()\n}\n" 5 4 --- 6 5 error: Unsupported target
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__javascript_targeted_function_cant_contain_erlang_only_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 158 4 3 expression: "@target(javascript)\npub fn javascript_only() -> Int {\n erlang_only()\n}\n\n@external(erlang, \"one\", \"two\")\nfn erlang_only() -> Int\n " 5 4 --- 6 5 error: Unsupported target
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__public_erlang_external.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 209 4 3 expression: "@external(erlang, \"one\", \"two\")\npub fn main() -> Int\n" 5 4 --- 6 5 error: Unsupported target ··· 12 11 The `main` function is public but doesn't have an implementation for 13 12 the JavaScript target. All public functions of a package must be able to 14 13 compile for a module to be valid. 15 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__public_javascript_external.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/externals.rs 3 - assertion_line: 199 4 3 expression: "@external(javascript, \"one\", \"two\")\npub fn main() -> Int\n" 5 4 --- 6 5 error: Unsupported target ··· 12 11 The `main` function is public but doesn't have an implementation for the 13 12 Erlang target. All public functions of a package must be able to compile 14 13 for a module to be valid. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__annotation_mismatch_function_fault_tolerance.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 212 4 3 expression: "\npub fn bad(x: Int) -> Float {\n // This does not match the return annotation\n 1\n}\n\npub fn user() -> Float {\n // This checks that the bad function is still usable, the types coming from\n // its annotations. This function is valid.\n bad(1)\n}\n\n// Another bad function to make sure that analysis has not stopped. This error\n// should also be emitted.\npub fn bad_2() {\n bad(Nil)\n}\n" 5 4 --- 6 5 error: Type mismatch
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__bad_body_function_fault_tolerance.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 187 4 3 expression: "\npub fn bad(x: Int) -> Float {\n // Invalid body.\n \"\" + \"\"\n}\n\npub fn user() -> Float {\n // This checks that the bad function is still usable, the types coming from\n // its annotations. This function is valid.\n bad(1)\n}\n\n// Another bad function to make sure that analysis has not stopped. This error\n// should also be emitted.\npub fn bad_2() {\n bad(Nil)\n}\n" 5 4 --- 6 5 error: Type mismatch
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__invalid_javascript_external_do_not_stop_analysis.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 253 4 3 expression: "\n@external(javascript, \"somemodule\", \"() => 123\")\npub fn one() -> Nil {\n Nil\n}\n\npub fn two() -> Nil {\n \"\"\n}\n" 5 4 --- 6 5 error: Invalid JavaScript function
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__no_impl_function_fault_tolerance.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 175 4 3 expression: "\npub fn no_impl() -> Nil\n\npub type X = UnknownType\n" 5 4 --- 6 5 error: Function without an implementation
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__recursive_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 159 4 3 expression: "\npub fn one(x) {\n two([x])\n}\n\npub fn two(x) {\n one(x)\n}\n" 5 4 --- 6 5 error: Recursive type ··· 13 12 to be defined in terms of itself. 14 13 15 14 Hint: Add some type annotations and try again. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__unlabelled_after_labelled.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 6 4 3 expression: "fn main(wibble wibber, wobber) {\n Nil\n}" 5 4 --- 6 5 error: Unlabelled argument after labelled argument ··· 10 9 │ ^^^^^^ 11 10 12 11 All unlabelled arguments must come before any labelled arguments. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__unlabelled_after_labelled_external.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 26 4 3 expression: "\n@external(erlang, \"\", \"\")\nfn main(wibble x: Int, y: Int) -> Int\n" 5 4 --- 6 5 error: Unlabelled argument after labelled argument ··· 10 9 │ ^^^^^^ 11 10 12 11 All unlabelled arguments must come before any labelled arguments. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__unlabelled_after_labelled_with_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 16 4 3 expression: "fn main(wibble wibber, wobber: Int) {\n Nil\n}" 5 4 --- 6 5 error: Unlabelled argument after labelled argument ··· 10 9 │ ^^^^^^^^^^^ 11 10 12 11 All unlabelled arguments must come before any labelled arguments. 13 -
-17
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__functions__unused_function_body.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/functions.rs 3 - assertion_line: 175 4 - expression: "\n@external(javascript, \"foo\", \"bar\")\n@external(erlang, \"foo\", \"bar\")\npub fn foo() -> Int {\n // This is dead code since there already is an\n // external implementation for all targets.\n 11\n}" 5 - --- 6 - 7 - warning: Unused function body 8 - ┌─ /src/warning/wrn.gleam:4:1 9 - 10 - 4 │ pub fn foo() -> Int { 11 - │ ^^^^^^^^^^^^^^^^^^^ 12 - 13 - This function has external implementations for all targets so the body is 14 - never used. 15 - 16 - Hint: The body can be safely removed 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__guards__string_variable_access.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/guards.rs 3 - assertion_line: 37 4 3 expression: "\npub fn a(a: String) {\n case a {\n _ if a.b -> 1\n _ -> 0\n }\n}\n" 5 4 --- 6 5 error: Unknown record field ··· 14 13 String 15 14 16 15 It does not have any fields. 17 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__import_errors_do_not_block_analysis.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 300 4 3 expression: "import unknown_module\n\npub fn main() {\n 1 + Nil\n}" 5 4 --- 6 5 error: Unknown module
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__import_type_duplicate_with_as.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 226 4 3 expression: "import one.{type One as MyOne, type One as MyOne}\n\npub type X = One\n" 5 4 --- 6 5 error: Duplicate type definition
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__import_type_duplicate_with_as_multiline.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 237 4 3 expression: "import one.{\n type One as MyOne,\n type One as MyOne\n }\n\npub type X = One\n" 5 4 --- 6 5 error: Duplicate type definition
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__imported_constructor_instead_of_type.snap
··· 11 11 The type `Foo` is not defined or imported in this module. 12 12 There is a value in scope with the name `Foo`, but no type in scope with 13 13 that name. 14 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__unqualified_import_errors_do_not_block_later_unqualified.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 307 4 3 expression: "import gleam.{Unknown, type Int as Integer}\n\npub fn main() -> Integer {\n Nil\n}" 5 4 --- 6 5 error: Unknown module field
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__unqualified_using_opaque_constructo.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 175 4 3 expression: "import one.{Two}\n\npub fn main() {\n Two\n}" 5 4 --- 6 5 error: Unknown module field
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__unqualified_using_private_constructo.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 151 4 3 expression: "import one.{Two}\n\npub fn main() {\n Two\n}" 5 4 --- 6 5 error: Unknown module field
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__unqualified_using_private_constructor_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 163 4 3 expression: "import one.{Two}\n\npub fn main(x) {\n let Two = x\n}" 5 4 --- 6 5 error: Unknown module field
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__unqualified_using_private_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 187 4 3 expression: "import one.{two}\n\npub fn main() {\n two\n}" 5 4 --- 6 5 error: Unknown module field
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_opaque_constructo.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 55 4 3 expression: "import one\n\npub fn main() {\n one.Two\n}" 5 4 --- 6 5 error: Unknown module field ··· 10 9 │ ^^^^ 11 10 12 11 The module `one` does not have a `Two` value. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_constructo.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 31 4 3 expression: "import one\n\npub fn main() {\n one.Two\n}" 5 4 --- 6 5 error: Unknown module field ··· 10 9 │ ^^^^ 11 10 12 11 The module `one` does not have a `Two` value. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_constructor_pattern.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 43 4 3 expression: "import one\n\npub fn main(x) {\n let one.Two = x\n}" 5 4 --- 6 5 error: Unknown module field ··· 10 9 │ ^^^^^^^ 11 10 12 11 The module `one` does not have a `Two` value. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_custom_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 127 4 3 expression: "import one\n\npub fn main() {\n one.X\n}" 5 4 --- 6 5 error: Unknown module field ··· 10 9 │ ^^ 11 10 12 11 The module `one` does not have a `X` value. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_external_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 103 4 3 expression: "import one\n\npub fn main() {\n one.X\n}" 5 4 --- 6 5 error: Unknown module field ··· 10 9 │ ^^ 11 10 12 11 The module `one` does not have a `X` value. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 67 4 3 expression: "import one\n\npub fn main() {\n one.two\n}" 5 4 --- 6 5 error: Unknown module field ··· 10 9 │ ^^^^ 11 10 12 11 The module `one` does not have a `two` value. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_type_alias.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 79 4 3 expression: "import one\n\npub fn main() {\n one.X\n}" 5 4 --- 6 5 error: Unknown module field ··· 10 9 │ ^^ 11 10 12 11 The module `one` does not have a `X` value. 13 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_unqualified_custom_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 139 4 3 expression: "import one.{X}\n\npub fn main() {\n X\n}" 5 4 --- 6 5 error: Unknown module field
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_unqualified_external_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 115 4 3 expression: "import one.{X}\n\npub fn main() {\n X\n}" 5 4 --- 6 5 error: Unknown module field
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_unqualified_type_alias.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/imports.rs 3 - assertion_line: 91 4 3 expression: "import one.{X}\n\npub fn main() {\n X\n}" 5 4 --- 6 5 error: Unknown module field
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__pretty__prelude_type_clash_custom_first.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/pretty.rs 3 - assertion_line: 34 4 3 expression: "print(tuple(vec![custom_bool(), bool()]))" 5 4 --- 6 5 #(Bool, gleam.Bool)
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__pretty__prelude_type_clash_prelude_first.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/pretty.rs 3 - assertion_line: 29 4 3 expression: "print(tuple(vec![bool(), custom_bool()]))" 5 4 --- 6 5 #(Bool, one/two.Bool)
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__pretty__repeated_prelude_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/pretty.rs 3 - assertion_line: 24 4 3 expression: "print(tuple(vec![int(), int(), int()]))" 5 4 --- 6 5 #(Int, Int, Int)
+1 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__target_implementations__function_with_no_valid_implementations.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/target_implementations.rs 3 - assertion_line: 254 4 - expression: "\n@external(javascript, \"foo\", \"bar\")\nfn javascript_only() -> Int\n \n@external(erlang, \"foo\", \"bar\")\nfn erlang_only() -> Int\n\npub fn main() {\n javascript_only()\n erlang_only()\n}\n" 3 + expression: "\n@external(javascript, \"foo\", \"bar\")\nfn javascript_only() -> Int\n\n@external(erlang, \"foo\", \"bar\")\nfn erlang_only() -> Int\n\npub fn main() {\n javascript_only()\n erlang_only()\n}\n" 5 4 --- 6 5 error: Unsupported target 7 6 ┌─ /src/one/two.gleam:9:5
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__type_alias__alias_cycle.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/type_alias.rs 3 - assertion_line: 43 4 3 expression: "\ntype A = B\ntype B = C\ntype C = D\ntype D = E\ntype E = A\n" 5 4 --- 6 5 error: Type cycle ··· 24 23 └─────┘ 25 24 If we tried to compile this recursive type it would expand 26 25 forever in a loop, and we'd never get the final type. 27 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__type_alias__alias_direct_cycle.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/type_alias.rs 3 - assertion_line: 56 4 3 expression: "\ntype A = #(A, A)\n" 5 4 --- 6 5 error: Type cycle ··· 16 15 └─────┘ 17 16 If we tried to compile this recursive type it would expand 18 17 forever in a loop, and we'd never get the final type. 19 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__type_alias__duplicate_parameter.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/type_alias.rs 3 - assertion_line: 78 4 3 expression: "\ntype A(a, a) =\n List(a)\n" 5 4 --- 6 5 error: Duplicate type parameter ··· 12 11 13 12 This definition has multiple type parameters named `a`. 14 13 Rename or remove one of them. 15 -
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__type_alias__duplicate_variable_error_does_not_stop_analysis.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/type_alias.rs 3 - assertion_line: 113 4 3 expression: "\ntype Two(a, a) =\n #(a, a)\n\ntype UnknownType =\n Dunno\n" 5 4 --- 6 5 error: Duplicate type parameter
-1
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__type_alias__type_alias_error_does_not_stop_analysis.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/type_alias.rs 3 - assertion_line: 99 4 3 expression: "\ntype UnusedParameter(a) =\n Int\n\ntype UnknownType =\n Dunno\n" 5 4 --- 6 5 error: Unused type parameter
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__type_alias__unused_parameter.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/type_alias.rs 3 - assertion_line: 88 4 3 expression: "\ntype A(a) =\n Int\n" 5 4 --- 6 5 error: Unused type parameter ··· 11 10 │ ╰─────^ 12 11 13 12 The type variable `a` is unused. It can be safely removed. 14 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__use___just_use_in_fn_body.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/use_.rs 3 - assertion_line: 151 4 3 expression: "\npub fn main() {\n use <- wibble()\n}\n\nfn wibble(f) {\n f()\n}\n" 5 4 --- 6 - 7 5 warning: Incomplete use expression 8 6 ┌─ /src/warning/wrn.gleam:3:3 9 7 ··· 14 12 running your program. 15 13 A use expression must always be followed by at least one more 16 14 expression. 17 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__use___no_callback_body.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/use_.rs 3 - assertion_line: 104 4 3 expression: "\npub fn main() {\n let thingy = fn(f) { f() }\n use <- thingy()\n}\n" 5 4 --- 6 - 7 5 warning: Incomplete use expression 8 6 ┌─ /src/warning/wrn.gleam:4:3 9 7 ··· 14 12 running your program. 15 13 A use expression must always be followed by at least one more 16 14 expression. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__use___typed_pattern_wrong_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/use_.rs 3 - assertion_line: 246 4 3 expression: "\npub fn main() {\n use Box(x): Box(Bool), Box(y), Box(z) <- apply(Box(1))\n x + y + z\n}\n\ntype Box(a) {\n Box(a)\n}\n\nfn apply(arg, fun) {\n fun(arg, arg, arg)\n}\n" 5 4 --- 6 5 error: Type mismatch ··· 16 15 Found type: 17 16 18 17 Box(Int) 19 -
-18
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecate_type_import_extenal.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 1013 4 - expression: "\nimport module.{X}\npub type Y = X\n" 5 - --- 6 - 7 - warning: Deprecated type import 8 - ┌─ /src/warning/wrn.gleam:2:16 9 - 10 - 2 │ import module.{X} 11 - │ ^ 12 - 13 - The syntax for importing a type has changed. The new syntax is: 14 - 15 - import module.{type X} 16 - 17 - Hint: Run `gleam fix` to auto-fix your code. 18 -
-18
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecate_type_import_type_alias.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 1024 4 - expression: "\nimport module.{X}\npub type Y = X\n" 5 - --- 6 - 7 - warning: Deprecated type import 8 - ┌─ /src/warning/wrn.gleam:2:16 9 - 10 - 2 │ import module.{X} 11 - │ ^ 12 - 13 - The syntax for importing a type has changed. The new syntax is: 14 - 15 - import module.{type X} 16 - 17 - Hint: Run `gleam fix` to auto-fix your code. 18 -
-18
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecate_type_import_type_custom_type.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 1035 4 - expression: "\nimport module.{X}\npub type Y = X\n" 5 - --- 6 - 7 - warning: Deprecated type import 8 - ┌─ /src/warning/wrn.gleam:2:16 9 - 10 - 2 │ import module.{X} 11 - │ ^ 12 - 13 - The syntax for importing a type has changed. The new syntax is: 14 - 15 - import module.{type X} 16 - 17 - Hint: Run `gleam fix` to auto-fix your code. 18 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_bit_array_type.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 883 4 - expression: pub type B = BitString 5 - --- 6 - 7 - warning: Deprecated BitString name used 8 - ┌─ /src/warning/wrn.gleam:1:14 9 - 10 - 1 │ pub type B = BitString 11 - │ ^^^^^^^^^ 12 - 13 - The type BitString has been renamed to BitArray. 14 - 15 - Hint: Run `gleam fix` to auto-fix your code. 16 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_bit_array_type_aliased.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 934 4 - expression: "\nimport gleam.{type BitString as BibbleWib}\npub type B = BibbleWib\n" 5 - --- 6 - 7 - warning: Deprecated BitString name used 8 - ┌─ /src/warning/wrn.gleam:2:15 9 - 10 - 2 │ import gleam.{type BitString as BibbleWib} 11 - │ ^^^^^^^^^^^^^^ 12 - 13 - The type BitString has been renamed to BitArray. 14 - 15 - Hint: Run `gleam fix` to auto-fix your code. 16 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_bit_array_type_imported.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 888 4 - expression: "\nimport gleam\npub type B = gleam.BitString\n" 5 - --- 6 - 7 - warning: Deprecated BitString name used 8 - ┌─ /src/warning/wrn.gleam:3:14 9 - 10 - 3 │ pub type B = gleam.BitString 11 - │ ^^^^^^^^^^^^^^^ 12 - 13 - The type BitString has been renamed to BitArray. 14 - 15 - Hint: Run `gleam fix` to auto-fix your code. 16 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_bit_string_type.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 883 4 - expression: pub type B = BitString 5 - --- 6 - 7 - warning: Deprecated BitString name used 8 - ┌─ /src/warning/wrn.gleam:1:14 9 - 10 - 1 │ pub type B = BitString 11 - │ ^^^^^^^^^ 12 - 13 - The type BitString has been renamed to BitArray. 14 - 15 - Hint: Run `gleam fix` to auto-fix your code. 16 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_bit_string_type_aliased.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 898 4 - expression: "\nimport gleam.{BitString as BibbleWib}\npub type B = BibbleWib\n" 5 - --- 6 - 7 - warning: Deprecated BitString name used 8 - ┌─ /src/warning/wrn.gleam:2:15 9 - 10 - 2 │ import gleam.{BitString as BibbleWib} 11 - │ ^^^^^^^^^ 12 - 13 - The type BitString has been renamed to BitArray. 14 - 15 - Hint: Run `gleam fix` to auto-fix your code. 16 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_bit_string_type_imported.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 888 4 - expression: "\nimport gleam\npub type B = gleam.BitString\n" 5 - --- 6 - 7 - warning: Deprecated BitString name used 8 - ┌─ /src/warning/wrn.gleam:3:14 9 - 10 - 3 │ pub type B = gleam.BitString 11 - │ ^^^^^^^^^^^^^^^ 12 - 13 - The type BitString has been renamed to BitArray. 14 - 15 - Hint: Run `gleam fix` to auto-fix your code. 16 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_constant.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n@deprecated(\"Don't use this!\")\npub const a = Nil\n\npub fn b() {\n a\n}\n" 4 4 --- 5 - 6 5 warning: Deprecated value used 7 6 ┌─ /src/warning/wrn.gleam:6:3 8 7 ··· 10 9 │ ^ This value has been deprecated 11 10 12 11 It was deprecated with this message: Don't use this! 13 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 867 4 3 expression: "\n@deprecated(\"Don't use this!\")\npub fn a() {\n Nil\n}\n\npub fn b() {\n a\n}\n " 5 4 --- 6 - 7 5 warning: Deprecated value used 8 6 ┌─ /src/warning/wrn.gleam:8:3 9 7 ··· 11 9 │ ^ This value has been deprecated 12 10 13 11 It was deprecated with this message: Don't use this! 14 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_call_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 937 4 3 expression: "\nimport module\n\npub fn a() {\n module.a()\n}\n" 5 4 --- 6 - 7 5 warning: Deprecated value used 8 6 ┌─ /src/warning/wrn.gleam:5:9 9 7 ··· 11 9 │ ^^ This value has been deprecated 12 10 13 11 It was deprecated with this message: Don't use this! 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_constant.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\nimport module\n\npub fn a() {\n module.a\n}\n" 4 4 --- 5 - 6 5 warning: Deprecated value used 7 6 ┌─ /src/warning/wrn.gleam:5:9 8 7 ··· 10 9 │ ^^ This value has been deprecated 11 10 12 11 It was deprecated with this message: Don't use this! 13 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 919 4 3 expression: "\nimport module\n\npub fn a() {\n module.a\n}\n" 5 4 --- 6 - 7 5 warning: Deprecated value used 8 6 ┌─ /src/warning/wrn.gleam:5:9 9 7 ··· 11 9 │ ^^ This value has been deprecated 12 10 13 11 It was deprecated with this message: Don't use this! 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_unqualified_constant.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\nimport module.{a}\n\npub fn b() {\n a\n}\n" 4 4 --- 5 - 6 5 warning: Deprecated value used 7 6 ┌─ /src/warning/wrn.gleam:5:3 8 7 ··· 10 9 │ ^ This value has been deprecated 11 10 12 11 It was deprecated with this message: Don't use this! 13 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_unqualified_function.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 955 4 3 expression: "\nimport module.{a}\n\npub fn b() {\n a\n}\n" 5 4 --- 6 - 7 5 warning: Deprecated value used 8 6 ┌─ /src/warning/wrn.gleam:5:3 9 7 ··· 11 9 │ ^ This value has been deprecated 12 10 13 11 It was deprecated with this message: Don't use this! 14 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_type_used_as_arg.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n@deprecated(\"Don't use this!\")\npub type Cat {\n Cat(name: String)\n}\n\npub fn cat_name(cat: Cat) {\n cat.name\n}\n " 4 4 --- 5 - 6 5 warning: Deprecated type used 7 6 ┌─ /src/warning/wrn.gleam:7:22 8 7 ··· 10 9 │ ^^^ This type has been deprecated 11 10 12 11 It was deprecated with this message: Don't use this! 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_type_used_as_case_clause.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n@deprecated(\"The type Animal has been deprecated.\")\npub type Animal {\n Cat\n Dog\n}\n\npub fn sound(animal) -> String {\n case animal {\n Dog -> \"Woof\"\n Cat -> \"Meow\"\n }\n}\n\npub fn main(){\n let cat = Cat\n sound(cat)\n}\n " 4 4 --- 5 - 6 5 warning: Deprecated value used 7 6 ┌─ /src/warning/wrn.gleam:10:5 8 7 ··· 26 25 │ ^^^ This value has been deprecated 27 26 28 27 It was deprecated with this message: The type Animal has been deprecated. 29 -
+1 -3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_type_used_in_alias.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\n@deprecated(\"Don't use this!\")\npub type Cat {\n Cat(name: String)\n}\n\npub type Dog = Cat\n\npub fn b() {\n let c = Dog(\"Bob\")\n}\n " 3 + expression: "\n@deprecated(\"Don't use this!\")\npub type Cat {\n Cat(name: String)\n}\n\npub type Dog = Cat\n " 4 4 --- 5 - 6 5 warning: Deprecated type used 7 6 ┌─ /src/warning/wrn.gleam:7:16 8 7 ··· 10 9 │ ^^^ This type has been deprecated 11 10 12 11 It was deprecated with this message: Don't use this! 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__double_unary_bool_literal.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "pub fn main() { let _ = !!True }" 4 4 --- 5 - 6 5 warning: Unnecessary double negation (!!) on bool 7 6 ┌─ /src/warning/wrn.gleam:1:25 8 7 ··· 10 9 │ ^^^^^^ 11 10 12 11 Hint: You can safely remove this. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__double_unary_bool_variable.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n pub fn main() {\n let x = True\n let _ = !!x\n }\n " 4 4 --- 5 - 6 5 warning: Unnecessary double negation (!!) on bool 7 6 ┌─ /src/warning/wrn.gleam:4:21 8 7 ··· 10 9 │ ^^^ 11 10 12 11 Hint: You can safely remove this. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__double_unary_integer_literal.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "pub fn main() { let _ = --7 }" 4 4 --- 5 - 6 5 warning: Unnecessary double negation (--) on integer 7 6 ┌─ /src/warning/wrn.gleam:1:25 8 7 ··· 10 9 │ ^^^ 11 10 12 11 Hint: You can safely remove this. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__double_unary_integer_variable.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n pub fn main() {\n let x = 7\n let _ = --x\n }\n " 4 4 --- 5 - 6 5 warning: Unnecessary double negation (--) on integer 7 6 ┌─ /src/warning/wrn.gleam:4:21 8 7 ··· 10 9 │ ^^^ 11 10 12 11 Hint: You can safely remove this. 13 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__empty_func_warning_test.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 50 4 3 expression: "pub fn main() { foo() }\n pub fn foo() { }" 5 4 --- 6 - 7 5 warning: Unimplemented function 8 6 ┌─ /src/warning/wrn.gleam:2:9 9 7 ··· 12 10 13 11 This code will crash if it is run. Be sure to finish it before 14 12 running your program. 15 -
-4
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__importing_non_direct_dep_package.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 877 4 3 expression: "\nimport some_module\npub const x = some_module.x\n " 5 4 --- 6 - 7 5 warning: Transitive dependency imported 8 6 ┌─ /src/warning/wrn.gleam:2:1 9 7 ··· 17 15 Run this command to add it to your dependencies: 18 16 19 17 gleam add non-dependency-package 20 - 21 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__internal_type_in_public_constructor.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\n@internal\npub type Wibble {\n Wibble\n}\n\npub type Wobble {\n Wobble(Wibble)\n}\n" 4 - --- 5 - warning: Internal type used in public interface 6 - ┌─ /src/warning/wrn.gleam:8:5 7 - 8 - 8 │ Wobble(Wibble) 9 - │ ^^^^^^^^^^^^^^ 10 - 11 - The following type is internal, but is being used by this public export. 12 - 13 - Wibble 14 - 15 - Internal types should not be used in a public facing function since they are 16 - hidden from the package's documentation.
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__internal_type_in_public_function_argument.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\n@internal\npub type Wibble {\n Wibble\n}\n\npub fn wibble(_wibble: Wibble) -> Int { 1 }\n" 4 - --- 5 - warning: Internal type used in public interface 6 - ┌─ /src/warning/wrn.gleam:7:1 7 - 8 - 7 │ pub fn wibble(_wibble: Wibble) -> Int { 1 } 9 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 - 11 - The following type is internal, but is being used by this public export. 12 - 13 - Wibble 14 - 15 - Internal types should not be used in a public facing function since they are 16 - hidden from the package's documentation.
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__internal_type_in_public_function_return.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\n@internal\npub type Wibble {\n Wibble\n}\n\npub fn wibble() -> Wibble { Wibble }\n" 4 - --- 5 - warning: Internal type used in public interface 6 - ┌─ /src/warning/wrn.gleam:7:1 7 - 8 - 7 │ pub fn wibble() -> Wibble { Wibble } 9 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 10 - 11 - The following type is internal, but is being used by this public export. 12 - 13 - Wibble 14 - 15 - Internal types should not be used in a public facing function since they are 16 - hidden from the package's documentation.
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__panic_used_as_function_inside_pipeline_1.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\n pub fn wibble(_) { 1 }\n pub fn main() {\n 1 |> wibble |> panic\n }\n " 4 - --- 5 - warning: Panic used as a function 6 - ┌─ /src/warning/wrn.gleam:4:13 7 - 8 - 4 │ 1 |> wibble |> panic 9 - │ ^^^^^^^^^^^ 10 - 11 - `panic` is not a function and will crash before it can do anything with 12 - this argument. 13 - 14 - Hint: if you want to display an error message you should write 15 - `panic as "my error message"` 16 - See: https://tour.gleam.run/advanced-features/panic/
-11
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__panic_used_as_function_inside_pipeline_2.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\n pub fn wibble(_) { 1 }\n pub fn main() {\n 1 |> panic |> wibble\n }\n " 4 - --- 5 - warning: Unreachable code 6 - ┌─ /src/warning/wrn.gleam:4:27 7 - 8 - 4 │ 1 |> panic |> wibble 9 - │ ^^^^^^ 10 - 11 - This code is unreachable because it comes after a `panic`.
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_0_eq_list_length.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = 0 == list.length(a_list)\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list == []` instead. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_0_not_eq_list_length.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = 0 != list.length(a_list)\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list != []` instead. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_list_length_eq_0.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = list.length(a_list) == 0\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list == []` instead. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_list_length_eq_negative_0.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = list.length(a_list) == -0\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list == []` instead. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_list_length_lt_1.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = list.length(a_list) < 1\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list == []` instead. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_list_length_lt_eq_0.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = list.length(a_list) <= 0\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list == []` instead. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_list_length_not_eq_0.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = list.length(a_list) != 0\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list != []` instead. 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__prefer_list_is_empty_over_negative_0_eq_list_length.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\n import gleam/list\n\n pub fn main() {\n let a_list = []\n let _ = -0 == list.length(a_list)\n }\n " 4 4 --- 5 - 6 5 warning: Inefficient use of `list.length` 7 6 ┌─ /src/warning/wrn.gleam:6:21 8 7 ··· 14 13 need to know if the list is empty or not. 15 14 16 15 Hint: You can use `the_list == []` instead. 17 -
-3
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__todo_warning_correct_location.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 32 4 3 expression: "pub fn main() {\n todo\n }" 5 4 --- 6 - 7 5 warning: Todo found 8 6 ┌─ /src/warning/wrn.gleam:2:9 9 7 ··· 12 10 13 11 This code will crash if it is run. Be sure to finish it before 14 12 running your program. 15 -
-4
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__todo_with_known_type.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 41 4 3 expression: "pub fn main() -> String {\n todo\n}" 5 4 --- 6 - 7 5 warning: Todo found 8 6 ┌─ /src/warning/wrn.gleam:2:3 9 7 ··· 14 12 running your program. 15 13 16 14 Hint: I think its type is `String`. 17 - 18 -
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__type_from_internal_module_dependency_in_public_constructor.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\nimport dep/internal.{type Wibble}\n\npub type Wobble {\n Wobble(Wibble)\n}" 4 - --- 5 - warning: Internal type used in public interface 6 - ┌─ /src/warning/wrn.gleam:5:3 7 - 8 - 5 │ Wobble(Wibble) 9 - │ ^^^^^^^^^^^^^^ 10 - 11 - The following type is internal, but is being used by this public export. 12 - 13 - Wibble 14 - 15 - Internal types should not be used in a public facing function since they are 16 - hidden from the package's documentation.
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__type_from_internal_module_in_public_constructor.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\nimport thepackage/internal.{type Wibble}\n\npub type Wobble {\n Wobble(Wibble)\n}" 4 - --- 5 - warning: Internal type used in public interface 6 - ┌─ /src/warning/wrn.gleam:5:3 7 - 8 - 5 │ Wobble(Wibble) 9 - │ ^^^^^^^^^^^^^^ 10 - 11 - The following type is internal, but is being used by this public export. 12 - 13 - Wibble 14 - 15 - Internal types should not be used in a public facing function since they are 16 - hidden from the package's documentation.
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__type_from_internal_module_in_public_function_argument.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\nimport thepackage/internal.{type Wibble}\n\npub fn wibble(_wibble: Wibble) -> Int {\n 1\n}\n" 4 - --- 5 - warning: Internal type used in public interface 6 - ┌─ /src/warning/wrn.gleam:4:1 7 - 8 - 4 │ pub fn wibble(_wibble: Wibble) -> Int { 9 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 - 11 - The following type is internal, but is being used by this public export. 12 - 13 - Wibble 14 - 15 - Internal types should not be used in a public facing function since they are 16 - hidden from the package's documentation.
-16
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__type_from_internal_module_in_public_function_return.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\nimport thepackage/internal.{type Wibble, Wibble}\n\npub fn wibble() -> Wibble {\n Wibble\n}" 4 - --- 5 - warning: Internal type used in public interface 6 - ┌─ /src/warning/wrn.gleam:4:1 7 - 8 - 4 │ pub fn wibble() -> Wibble { 9 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 10 - 11 - The following type is internal, but is being used by this public export. 12 - 13 - Wibble 14 - 15 - Internal types should not be used in a public facing function since they are 16 - hidden from the package's documentation.
-11
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__unreachable_function_after_panic.snap
··· 1 - --- 2 - source: compiler-core/src/type_/tests/warnings.rs 3 - expression: "\n pub fn wibble(_) { 1 }\n pub fn main() {\n panic\n wibble(10)\n }\n " 4 - --- 5 - warning: Unreachable code 6 - ┌─ /src/warning/wrn.gleam:5:13 7 - 8 - 5 │ wibble(10) 9 - │ ^^^^^^^^^^ 10 - 11 - This code is unreachable because it comes after a `panic`.
-4
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__unused_imported_module_with_alias_and_unqualified_name_no_warnings_test.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 - assertion_line: 474 4 3 expression: "import gleam/one.{two} as three\npub fn baz() { two() }" 5 4 --- 6 - 7 5 warning: Unused imported module alias 8 6 ┌─ /src/warning/wrn.gleam:1:24 9 7 ··· 13 11 Hint: You can safely remove it. 14 12 15 13 import gleam/one as _ 16 - 17 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__warning_many_at_same_time.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\nfn main() { let five = 5 }" 4 4 --- 5 - 6 5 warning: Unused variable 7 6 ┌─ /src/warning/wrn.gleam:2:17 8 7 ··· 18 17 │ ^^^^^^^^^ This private function is never used 19 18 20 19 Hint: You can safely remove it. 21 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__warning_private_function_never_used.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "fn main() { 5 }" 4 4 --- 5 - 6 5 warning: Unused private function 7 6 ┌─ /src/warning/wrn.gleam:1:1 8 7 ··· 10 9 │ ^^^^^^^^^ This private function is never used 11 10 12 11 Hint: You can safely remove it. 13 -
-2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__warning_variable_never_used_test.snap
··· 2 2 source: compiler-core/src/type_/tests/warnings.rs 3 3 expression: "\npub fn foo() { Ok(5) }\npub fn main() { let five = foo() }" 4 4 --- 5 - 6 5 warning: Unused variable 7 6 ┌─ /src/warning/wrn.gleam:3:21 8 7 ··· 10 9 │ ^^^^ This variable is never used 11 10 12 11 Hint: You can ignore it with an underscore: `_five`. 13 -