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

Configure Feed

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

Simplify test

+15 -26
+11 -18
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__use___discard_pattern_type_annotation_is_checked.snap
··· 1 1 --- 2 2 source: compiler-core/src/type_/tests/use_.rs 3 - expression: "\npub type Woo(a) {\n Woo\n}\n\npub fn wibble(_f: fn(Woo(a)) -> Nil) -> Woo(a) {\n Woo\n}\n\npub fn main() -> Woo(Int) {\n use _: Woo(String) <- wibble()\n Nil\n}\n" 3 + expression: "\nfn wibble(f: fn(Int, String) -> Nil) -> Nil {\n f(1, \"\")\n}\n\npub fn main() {\n use _a: Int, _b: Float <- wibble()\n Nil\n}\n" 4 4 --- 5 5 ----- SOURCE CODE 6 6 7 - pub type Woo(a) { 8 - Woo 7 + fn wibble(f: fn(Int, String) -> Nil) -> Nil { 8 + f(1, "") 9 9 } 10 10 11 - pub fn wibble(_f: fn(Woo(a)) -> Nil) -> Woo(a) { 12 - Woo 13 - } 14 - 15 - pub fn main() -> Woo(Int) { 16 - use _: Woo(String) <- wibble() 11 + pub fn main() { 12 + use _a: Int, _b: Float <- wibble() 17 13 Nil 18 14 } 19 15 20 16 21 17 ----- ERROR 22 18 error: Type mismatch 23 - ┌─ /src/one/two.gleam:11:3 24 - 25 - 11 │ use _: Woo(String) <- wibble() 26 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 27 - 28 - The type of this returned value doesn't match the return type 29 - annotation of this function. 19 + ┌─ /src/one/two.gleam:7:16 20 + 21 + 7 │ use _a: Int, _b: Float <- wibble() 22 + │ ^^^^^^^^^ 30 23 31 24 Expected type: 32 25 33 - Woo(Int) 26 + String 34 27 35 28 Found type: 36 29 37 - Woo(String) 30 + Float
+4 -8
compiler-core/src/type_/tests/use_.rs
··· 501 501 fn discard_pattern_type_annotation_is_checked() { 502 502 assert_module_error!( 503 503 r#" 504 - pub type Woo(a) { 505 - Woo 506 - } 507 - 508 - pub fn wibble(_f: fn(Woo(a)) -> Nil) -> Woo(a) { 509 - Woo 504 + fn wibble(f: fn(Int, String) -> Nil) -> Nil { 505 + f(1, "") 510 506 } 511 507 512 - pub fn main() -> Woo(Int) { 513 - use _: Woo(String) <- wibble() 508 + pub fn main() { 509 + use _a: Int, _b: Float <- wibble() 514 510 Nil 515 511 } 516 512 "#