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

Configure Feed

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

change module select location

+148 -209
+3 -3
compiler-core/src/ast/tests.rs
··· 366 366 #[test] 367 367 fn find_node_module_select() { 368 368 let expr = TypedExpr::ModuleSelect { 369 - location: SrcSpan { start: 1, end: 3 }, 369 + location: SrcSpan { start: 1, end: 4 }, 370 + field_start: 2, 370 371 type_: type_::int(), 371 372 label: "label".into(), 372 373 module_name: "name".into(), 373 374 module_alias: "alias".into(), 374 - module_location: SrcSpan { start: 0, end: 0 }, 375 375 constructor: ModuleValueConstructor::Fn { 376 376 module: "module".into(), 377 377 name: "function".into(), ··· 384 384 }; 385 385 386 386 assert_eq!(expr.find_node(0), None); 387 - assert_eq!(expr.find_node(1), Some(Located::Expression(&expr))); 387 + assert_eq!(expr.find_node(1), None); 388 388 assert_eq!(expr.find_node(2), Some(Located::Expression(&expr))); 389 389 assert_eq!(expr.find_node(3), Some(Located::Expression(&expr))); 390 390 }
+20 -17
compiler-core/src/ast/typed.rs
··· 97 97 }, 98 98 99 99 ModuleSelect { 100 - /// The location of the selected value coming after the `.` (including 101 - /// it): 102 - /// 103 - /// ```gleam 104 - /// wibble.wobble 105 - /// // ^^^^^^^ location 106 - /// ``` 107 - /// 108 100 location: SrcSpan, 101 + field_start: u32, 109 102 type_: Arc<Type>, 110 103 label: EcoString, 111 104 module_name: EcoString, 112 105 module_alias: EcoString, 113 - /// The location of the module before the `.`: 114 - /// 115 - /// ```gleam 116 - /// wibble.wobble 117 - /// // ^^^^^^ module_location 118 - /// ``` 119 - /// 120 - module_location: SrcSpan, 121 106 constructor: ModuleValueConstructor, 122 107 }, 123 108 ··· 210 195 | Self::Panic { .. } 211 196 | Self::Float { .. } 212 197 | Self::String { .. } 213 - | Self::ModuleSelect { .. } 214 198 | Self::Invalid { .. } => self.self_if_contains_location(byte_index), 199 + 200 + Self::ModuleSelect { 201 + location, 202 + field_start, 203 + .. 204 + } => { 205 + // We want to return the `ModuleSelect` only when we're hovering 206 + // over the selected field, not on the module part. 207 + let field_span = SrcSpan { 208 + start: *field_start, 209 + end: location.end, 210 + }; 211 + 212 + if field_span.contains(byte_index) { 213 + Some(self.into()) 214 + } else { 215 + None 216 + } 217 + } 215 218 216 219 Self::Todo { kind, .. } => match kind { 217 220 TodoKind::Keyword => self.self_if_contains_location(byte_index),
+2 -2
compiler-core/src/ast/untyped.rs
··· 78 78 // user.name 79 79 // ^^^^^^^^^ 80 80 location: SrcSpan, 81 - // This is the location of just the field access 81 + // This is the location of just the field access (ignoring the `.`) 82 82 // user.name 83 - // ^^^^^ 83 + // ^^^^ 84 84 label_location: SrcSpan, 85 85 label: EcoString, 86 86 container: Box<Self>,
+5 -5
compiler-core/src/ast/visit.rs
··· 214 214 fn visit_typed_expr_module_select( 215 215 &mut self, 216 216 location: &'ast SrcSpan, 217 + field_start: &'ast u32, 217 218 type_: &'ast Arc<Type>, 218 219 label: &'ast EcoString, 219 220 module_name: &'ast EcoString, 220 221 module_alias: &'ast EcoString, 221 - module_location: &'ast SrcSpan, 222 222 constructor: &'ast ModuleValueConstructor, 223 223 ) { 224 224 visit_typed_expr_module_select( 225 225 self, 226 226 location, 227 + field_start, 227 228 type_, 228 229 label, 229 230 module_name, 230 231 module_alias, 231 - module_location, 232 232 constructor, 233 233 ); 234 234 } ··· 761 761 } => v.visit_typed_expr_record_access(location, type_, label, index, record), 762 762 TypedExpr::ModuleSelect { 763 763 location, 764 + field_start, 764 765 type_, 765 766 label, 766 767 module_name, 767 768 module_alias, 768 - module_location, 769 769 constructor, 770 770 } => v.visit_typed_expr_module_select( 771 771 location, 772 + field_start, 772 773 type_, 773 774 label, 774 775 module_name, 775 776 module_alias, 776 - module_location, 777 777 constructor, 778 778 ), 779 779 TypedExpr::Tuple { ··· 993 993 pub fn visit_typed_expr_module_select<'a, V>( 994 994 _v: &mut V, 995 995 _location: &'a SrcSpan, 996 + _field_start: &'a u32, 996 997 _typ: &'a Arc<Type>, 997 998 _label: &'a EcoString, 998 999 _module_name: &'a EcoString, 999 1000 _module_alias: &'a EcoString, 1000 - _module_location: &'a SrcSpan, 1001 1001 _constructor: &'a ModuleValueConstructor, 1002 1002 ) where 1003 1003 V: Visit<'a> + ?Sized,
+18 -81
compiler-core/src/language_server/code_action.rs
··· 1258 1258 qualified_constructor: None, 1259 1259 } 1260 1260 } 1261 + 1261 1262 fn get_module_import( 1262 1263 &self, 1263 1264 module_name: &EcoString, ··· 1362 1363 fn visit_typed_expr_module_select( 1363 1364 &mut self, 1364 1365 location: &'ast SrcSpan, 1366 + field_start: &'ast u32, 1365 1367 type_: &'ast Arc<Type>, 1366 1368 label: &'ast EcoString, 1367 1369 module_name: &'ast EcoString, 1368 1370 module_alias: &'ast EcoString, 1369 - module_location: &'ast SrcSpan, 1370 1371 constructor: &'ast ModuleValueConstructor, 1371 1372 ) { 1372 1373 // When hovering over a Record Value Constructor, we want to expand the source span to ··· 1374 1375 // option.Some 1375 1376 // ↑ 1376 1377 // This allows us to offer a code action when hovering over the module name. 1377 - let range = src_span_to_lsp_range(module_location.merge(location), &self.line_numbers); 1378 + let range = src_span_to_lsp_range(*location, &self.line_numbers); 1378 1379 if overlaps(self.params.range, range) { 1379 1380 if let ModuleValueConstructor::Record { 1380 1381 name: constructor_name, ··· 1397 1398 ast::visit::visit_typed_expr_module_select( 1398 1399 self, 1399 1400 location, 1401 + field_start, 1400 1402 type_, 1401 1403 label, 1402 1404 module_name, 1403 1405 module_alias, 1404 - module_location, 1405 1406 constructor, 1406 1407 ) 1407 1408 } ··· 1452 1453 params: &'a CodeActionParams, 1453 1454 edits: TextEdits<'a>, 1454 1455 qualified_constructor: QualifiedConstructor<'a>, 1455 - } 1456 - 1457 - enum QualifiedConstructorType { 1458 - Type, 1459 - RecordValue, 1460 - PatternRecord, 1461 1456 } 1462 1457 1463 1458 impl<'a> QualifiedToUnqualifiedImportSecondPass<'a> { ··· 1493 1488 action 1494 1489 } 1495 1490 1496 - fn remove_module_qualifier( 1497 - &mut self, 1498 - location: SrcSpan, 1499 - constructor: QualifiedConstructorType, 1500 - ) { 1501 - // Find the start and end of the module qualifier 1502 - 1503 - // The src_span for Type Constructors and Pattern Record Constructors is 1504 - // : option.Option / option.Some but for Record Constructors is: option.Some 1505 - // ↑ ↑ ↑ ↑ ↑ ↑ 1506 - // start end start end start end 1507 - let span = if matches!(constructor, QualifiedConstructorType::RecordValue) { 1508 - SrcSpan::new( 1509 - location.start - self.qualified_constructor.used_name.len() as u32, 1510 - location.start + 1, 1511 - ) 1512 - } else { 1513 - SrcSpan::new( 1514 - location.start, 1515 - location.start + self.qualified_constructor.used_name.len() as u32 + 1, // plus . 1516 - ) 1517 - }; 1518 - self.edits.delete(span); 1491 + fn remove_module_qualifier(&mut self, location: SrcSpan) { 1492 + self.edits.delete(SrcSpan { 1493 + start: location.start, 1494 + end: location.start + self.qualified_constructor.used_name.len() as u32 + 1, // plus . 1495 + }) 1519 1496 } 1520 1497 1521 1498 fn edit_import(&mut self) { ··· 1693 1670 } = &self.qualified_constructor; 1694 1671 1695 1672 if !layer.is_value() && used_name == module_name && name == constructor { 1696 - self.remove_module_qualifier(*location, QualifiedConstructorType::Type); 1673 + self.remove_module_qualifier(*location); 1697 1674 } 1698 1675 } 1699 1676 ast::visit::visit_type_ast_constructor(self, location, module, name, arguments); ··· 1702 1679 fn visit_typed_expr_module_select( 1703 1680 &mut self, 1704 1681 location: &'ast SrcSpan, 1682 + field_start: &'ast u32, 1705 1683 type_: &'ast Arc<Type>, 1706 1684 label: &'ast EcoString, 1707 1685 module_name: &'ast EcoString, 1708 1686 module_alias: &'ast EcoString, 1709 - module_location: &'ast SrcSpan, 1710 1687 constructor: &'ast ModuleValueConstructor, 1711 1688 ) { 1712 1689 if let ModuleValueConstructor::Record { name, .. } = constructor { ··· 1718 1695 } = &self.qualified_constructor; 1719 1696 1720 1697 if layer.is_value() && used_name == module_alias && name == constructor { 1721 - self.remove_module_qualifier(*location, QualifiedConstructorType::RecordValue); 1698 + self.remove_module_qualifier(*location); 1722 1699 } 1723 1700 } 1724 1701 ast::visit::visit_typed_expr_module_select( 1725 1702 self, 1726 1703 location, 1704 + field_start, 1727 1705 type_, 1728 1706 label, 1729 1707 module_name, 1730 1708 module_alias, 1731 - module_location, 1732 1709 constructor, 1733 1710 ) 1734 1711 } ··· 1753 1730 } = &self.qualified_constructor; 1754 1731 1755 1732 if layer.is_value() && used_name == module_alias && name == constructor { 1756 - self.remove_module_qualifier( 1757 - *location, 1758 - QualifiedConstructorType::PatternRecord, 1759 - ); 1733 + self.remove_module_qualifier(*location); 1760 1734 } 1761 1735 } 1762 1736 } ··· 2787 2761 } 2788 2762 2789 2763 fn visit_typed_expr(&mut self, expr: &'ast TypedExpr) { 2790 - let expr_location = full_location(expr); 2764 + let expr_location = expr.location(); 2791 2765 let expr_range = self.edits.src_span_to_lsp_range(expr_location); 2792 2766 2793 2767 // If the expression is a top level statement we don't want to extract ··· 4425 4399 // pipeline and the call is `finally`. 4426 4400 let (call, call_kind) = assignments 4427 4401 .first() 4428 - .map(|(call, kind)| (full_location(&call.value), *kind)) 4429 - .unwrap_or_else(|| (full_location(finally), *finally_kind)); 4402 + .map(|(call, kind)| (call.location, *kind)) 4403 + .unwrap_or_else(|| (finally.location(), *finally_kind)); 4430 4404 4431 4405 self.locations = Some(ConvertToFunctionCallLocations { 4432 - first_value: full_location(&first_value.value), 4406 + first_value: first_value.location, 4433 4407 call, 4434 4408 call_kind, 4435 4409 }); ··· 4567 4541 self.maybe_inline(*location); 4568 4542 } 4569 4543 } 4570 - 4571 - /// Returns the SrcSpan covering the entire expression: this will be the same 4572 - /// as calling `.location()` on most elements with two notable exceptions: 4573 - /// `RecordAccess` and `ModuleSelect` where the returned `SrcSpan` will cover 4574 - /// the entire expression and not just the part following the `.` as you would 4575 - /// get calling `location`. 4576 - /// 4577 - fn full_location(expr: &TypedExpr) -> SrcSpan { 4578 - match expr { 4579 - TypedExpr::RecordAccess { location, .. } => *location, 4580 - TypedExpr::ModuleSelect { 4581 - location, 4582 - module_location, 4583 - .. 4584 - } => module_location.merge(location), 4585 - TypedExpr::Int { location, .. } 4586 - | TypedExpr::Float { location, .. } 4587 - | TypedExpr::String { location, .. } 4588 - | TypedExpr::Block { location, .. } 4589 - | TypedExpr::Pipeline { location, .. } 4590 - | TypedExpr::Var { location, .. } 4591 - | TypedExpr::Fn { location, .. } 4592 - | TypedExpr::List { location, .. } 4593 - | TypedExpr::Call { location, .. } 4594 - | TypedExpr::BinOp { location, .. } 4595 - | TypedExpr::Case { location, .. } 4596 - | TypedExpr::Tuple { location, .. } 4597 - | TypedExpr::TupleIndex { location, .. } 4598 - | TypedExpr::Todo { location, .. } 4599 - | TypedExpr::Panic { location, .. } 4600 - | TypedExpr::BitArray { location, .. } 4601 - | TypedExpr::RecordUpdate { location, .. } 4602 - | TypedExpr::NegateBool { location, .. } 4603 - | TypedExpr::NegateInt { location, .. } 4604 - | TypedExpr::Invalid { location, .. } => *location, 4605 - } 4606 - }
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_contextual_type_expression.snap
··· 6 6 7 7 pub fn main() { 8 8 let wibble = wobble.Wibble 9 - ▔▔▔▔▔↑▔ 9 + ▔▔▔▔▔▔▔▔▔▔▔↑▔ 10 10 } 11 11 12 12
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_external_imported_constants.snap
··· 5 5 import example_module 6 6 fn main() { 7 7 example_module.my_const 8 - ▔▔▔↑▔▔▔▔▔ 8 + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔↑▔▔▔▔▔ 9 9 } 10 10 11 11
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_external_imported_ffi_renamed_function.snap
··· 5 5 import example_module 6 6 fn main() { 7 7 example_module.my_fn 8 - ▔▔▔▔↑▔ 8 + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔↑▔ 9 9 } 10 10 11 11
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_external_imported_function.snap
··· 5 5 import example_module 6 6 fn main() { 7 7 example_module.my_fn 8 - ▔▔▔↑▔▔ 8 + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔↑▔▔ 9 9 } 10 10 11 11
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_external_imported_function_nested_module.snap
··· 5 5 import my/nested/example_module 6 6 fn main() { 7 7 example_module.my_fn 8 - ▔▔▔▔↑▔ 8 + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔↑▔ 9 9 } 10 10 11 11
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_external_imported_function_renamed_module.snap
··· 5 5 import example_module as renamed_module 6 6 fn main() { 7 7 renamed_module.my_fn 8 - ▔▔▔▔↑▔ 8 + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔↑▔ 9 9 } 10 10 11 11
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_external_value_with_two_modules_same_name.snap
··· 6 6 import b/example_module 7 7 fn main() { 8 8 example_module.my_const 9 - ▔▔▔▔↑▔▔▔▔ 9 + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔↑▔▔▔▔ 10 10 } 11 11 12 12
+1 -1
compiler-core/src/language_server/tests/snapshots/gleam_core__language_server__tests__hover__hover_imported_function.snap
··· 5 5 import example_module 6 6 fn main() { 7 7 example_module.my_fn 8 - ▔▔▔↑▔▔ 8 + ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔↑▔▔ 9 9 } 10 10 11 11
+4 -4
compiler-core/src/parse.rs
··· 820 820 } 821 821 } 822 822 823 - Some((_, Token::Name { name: label }, end)) => { 823 + Some((label_start, Token::Name { name: label }, end)) => { 824 824 self.advance(); 825 825 expr = UntypedExpr::FieldAccess { 826 826 location: SrcSpan { start, end }, 827 827 label_location: SrcSpan { 828 - start: dot_start, 828 + start: label_start, 829 829 end, 830 830 }, 831 831 label, ··· 833 833 } 834 834 } 835 835 836 - Some((_, Token::UpName { name: label }, end)) => { 836 + Some((label_start, Token::UpName { name: label }, end)) => { 837 837 self.advance(); 838 838 expr = UntypedExpr::FieldAccess { 839 839 location: SrcSpan { start, end }, 840 840 label_location: SrcSpan { 841 - start: dot_start, 841 + start: label_start, 842 842 end, 843 843 }, 844 844 label,
+8 -9
compiler-core/src/type_/expression.rs
··· 2193 2193 .and_then(|ma| match ma { 2194 2194 TypedExpr::ModuleSelect { 2195 2195 location, 2196 + field_start: _, 2196 2197 type_, 2197 2198 label, 2198 2199 module_name, 2199 2200 module_alias, 2200 - module_location: _, 2201 2201 constructor, 2202 2202 } => match constructor { 2203 2203 ModuleValueConstructor::Constant { literal, .. } => { ··· 2234 2234 module_location: &SrcSpan, 2235 2235 select_location: SrcSpan, 2236 2236 ) -> Result<TypedExpr, Error> { 2237 + let location = module_location.merge(&select_location); 2238 + 2237 2239 let (module_name, constructor) = { 2238 2240 let (_, module) = self 2239 2241 .environment ··· 2252 2254 .get_public_value(&label) 2253 2255 .ok_or_else(|| Error::UnknownModuleValue { 2254 2256 name: label.clone(), 2255 - location: SrcSpan { 2256 - start: module_location.end, 2257 - end: select_location.end, 2258 - }, 2257 + location: select_location, 2259 2258 module_name: module.name.clone(), 2260 2259 value_constructors: module.public_value_names(), 2261 2260 type_with_same_name: module.get_public_type(&label).is_some(), ··· 2297 2296 }; 2298 2297 2299 2298 Ok(TypedExpr::ModuleSelect { 2299 + location, 2300 + field_start: select_location.start, 2300 2301 label, 2301 2302 type_: Arc::clone(&type_), 2302 - module_location: *module_location, 2303 - location: select_location, 2304 2303 module_name, 2305 2304 module_alias: module_alias.clone(), 2306 2305 constructor, ··· 3031 3030 }; 3032 3031 3033 3032 TypedExpr::ModuleSelect { 3033 + location: module_location.merge(&location), 3034 + field_start: location.start, 3034 3035 label: name.clone(), 3035 3036 module_alias: module_alias.clone(), 3036 3037 module_name, 3037 - module_location: *module_location, 3038 3038 type_, 3039 3039 constructor: module_value_constructor, 3040 - location, 3041 3040 } 3042 3041 } 3043 3042
+2 -2
compiler-core/src/type_/snapshots/gleam_core__type___tests__type_unification_does_not_allow_different_variants_to_be_treated_as_safe.snap
··· 21 21 22 22 ----- ERROR 23 23 error: Unknown record field 24 - ┌─ /src/one/two.gleam:13:4 24 + ┌─ /src/one/two.gleam:13:5 25 25 26 26 13 │ a.b 27 - │ ^^ Did you mean `a`? 27 + │ ^ Did you mean `a`? 28 28 29 29 The value being accessed has this type: 30 30
+2 -2
compiler-core/src/type_/snapshots/gleam_core__type___tests__variant_inference_does_not_escape_clause_scope.snap
··· 20 20 21 21 ----- ERROR 22 22 error: Unknown record field 23 - ┌─ /src/one/two.gleam:12:4 23 + ┌─ /src/one/two.gleam:12:5 24 24 25 25 12 │ x.b 26 - │ ^^ This field does not exist 26 + │ ^ This field does not exist 27 27 28 28 The value being accessed has this type: 29 29
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__access_int.snap
··· 7 7 8 8 ----- ERROR 9 9 error: Unknown record field 10 - ┌─ /src/one/two.gleam:1:12 10 + ┌─ /src/one/two.gleam:1:13 11 11 12 12 1 │ let x = 1 x.whatever 13 - │ ^^^^^^^^^ This field does not exist 13 + │ ^^^^^^^^ This field does not exist 14 14 15 15 The value being accessed has this type: 16 16
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__accessor_multiple_variants_multiple_positions.snap
··· 13 13 14 14 ----- ERROR 15 15 error: Unknown record field 16 - ┌─ /src/one/two.gleam:7:40 16 + ┌─ /src/one/two.gleam:7:41 17 17 18 18 7 │ pub fn get_age(person: Person) { person.age } 19 - │ ^^^^ Did you mean `name`? 19 + │ ^^^ Did you mean `name`? 20 20 21 21 The value being accessed has this type: 22 22
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__accessor_multiple_variants_multiple_positions2.snap
··· 13 13 14 14 ----- ERROR 15 15 error: Unknown record field 16 - ┌─ /src/one/two.gleam:6:41 16 + ┌─ /src/one/two.gleam:6:42 17 17 18 18 6 │ pub fn get_name(person: Person) { person.name } 19 - │ ^^^^^ Did you mean `age`? 19 + │ ^^^^ Did you mean `age`? 20 20 21 21 The value being accessed has this type: 22 22
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__field_not_in_all_variants.snap
··· 12 12 13 13 ----- ERROR 14 14 error: Unknown record field 15 - ┌─ /src/one/two.gleam:6:42 15 + ┌─ /src/one/two.gleam:6:43 16 16 17 17 6 │ pub fn get_title(person: Person) { person.title } 18 - │ ^^^^^^ This field does not exist 18 + │ ^^^^^ This field does not exist 19 19 20 20 The value being accessed has this type: 21 21
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__field_not_in_any_variant.snap
··· 12 12 13 13 ----- ERROR 14 14 error: Unknown record field 15 - ┌─ /src/one/two.gleam:6:43 15 + ┌─ /src/one/two.gleam:6:44 16 16 17 17 6 │ pub fn get_height(person: Person) { person.height } 18 - │ ^^^^^^^ This field does not exist 18 + │ ^^^^^^ This field does not exist 19 19 20 20 The value being accessed has this type: 21 21
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__field_type_different_between_variants.snap
··· 13 13 14 14 ----- ERROR 15 15 error: Unknown record field 16 - ┌─ /src/one/two.gleam:6:35 16 + ┌─ /src/one/two.gleam:6:36 17 17 18 18 6 │ pub fn get_x(shape: Shape) { shape.x } 19 - │ ^^ This field does not exist 19 + │ ^ This field does not exist 20 20 21 21 The value being accessed has this type: 22 22
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__hint_for_method_call.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown record field 18 - ┌─ /src/one/two.gleam:7:7 18 + ┌─ /src/one/two.gleam:7:8 19 19 20 20 7 │ user.login() 21 - │ ^^^^^^ This field does not exist 21 + │ ^^^^^ This field does not exist 22 22 23 23 The value being accessed has this type: 24 24
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__no_hint_for_non_method_call.snap
··· 19 19 20 20 ----- ERROR 21 21 error: Unknown record field 22 - ┌─ /src/one/two.gleam:11:13 22 + ┌─ /src/one/two.gleam:11:14 23 23 24 24 11 │ login(user.wibble) 25 - │ ^^^^^^^ This field does not exist 25 + │ ^^^^^^ This field does not exist 26 26 27 27 The value being accessed has this type: 28 28
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__no_note_about_reliable_access_if_the_accessed_type_has_a_single_variant.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown record field 18 - ┌─ /src/one/two.gleam:7:14 18 + ┌─ /src/one/two.gleam:7:15 19 19 20 20 7 │ User("Jak").nam 21 - │ ^^^^ Did you mean `name`? 21 + │ ^^^ Did you mean `name`? 22 22 23 23 The value being accessed has this type: 24 24
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__qualified_type_invalid_pipe_argument.snap
··· 16 16 17 17 ----- ERROR 18 18 error: Type mismatch 19 - ┌─ /src/one/two.gleam:4:13 19 + ┌─ /src/one/two.gleam:4:10 20 20 21 21 4 │ Nil |> mod.takes_wibble 22 - │ ^^^^^^^^^^^^^ This function does not accept the piped type 22 + │ ^^^^^^^^^^^^^^^^ This function does not accept the piped type 23 23 24 24 The argument is: 25 25
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__qualified_type_unknown_field.snap
··· 16 16 17 17 ----- ERROR 18 18 error: Unknown record field 19 - ┌─ /src/one/two.gleam:8:15 19 + ┌─ /src/one/two.gleam:8:16 20 20 21 21 8 │ not_a_record.bits 22 - │ ^^^^^ This field does not exist 22 + │ ^^^^ This field does not exist 23 23 24 24 The value being accessed has this type: 25 25
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__record_access_on_inferred_variant_when_field_is_in_other_variants.snap
··· 17 17 18 18 ----- ERROR 19 19 error: Unknown record field 20 - ┌─ /src/one/two.gleam:9:16 20 + ┌─ /src/one/two.gleam:9:17 21 21 22 22 9 │ always_wibble.wobble 23 - │ ^^^^^^^ Did you mean `wibble`? 23 + │ ^^^^^^ Did you mean `wibble`? 24 24 25 25 The value being accessed has this type: 26 26
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_field.snap
··· 7 7 8 8 ----- ERROR 9 9 error: Unknown record field 10 - ┌─ /src/one/two.gleam:1:13 10 + ┌─ /src/one/two.gleam:1:14 11 11 12 12 1 │ fn(a: a) { a.field } 13 - │ ^^^^^^ This field does not exist 13 + │ ^^^^^ This field does not exist 14 14 15 15 The value being accessed has this type: 16 16
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_field_that_appears_in_a_variant_has_note.snap
··· 16 16 17 17 ----- ERROR 18 18 error: Unknown record field 19 - ┌─ /src/one/two.gleam:8:9 19 + ┌─ /src/one/two.gleam:8:10 20 20 21 21 8 │ wibble.field 22 - │ ^^^^^^ This field does not exist 22 + │ ^^^^^ This field does not exist 23 23 24 24 The value being accessed has this type: 25 25
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_field_that_appears_in_an_imported_variant_has_note.snap
··· 19 19 20 20 ----- ERROR 21 21 error: Unknown record field 22 - ┌─ /src/one/two.gleam:4:9 22 + ┌─ /src/one/two.gleam:4:10 23 23 24 24 4 │ wibble.field 25 - │ ^^^^^^ This field does not exist 25 + │ ^^^^^ This field does not exist 26 26 27 27 The value being accessed has this type: 28 28
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_field_that_does_not_appear_in_variant_has_no_note.snap
··· 16 16 17 17 ----- ERROR 18 18 error: Unknown record field 19 - ┌─ /src/one/two.gleam:8:9 19 + ┌─ /src/one/two.gleam:8:10 20 20 21 21 8 │ wibble.wibble 22 - │ ^^^^^^^ This field does not exist 22 + │ ^^^^^^ This field does not exist 23 23 24 24 The value being accessed has this type: 25 25
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_record_field.snap
··· 10 10 11 11 ----- ERROR 12 12 error: Unknown record field 13 - ┌─ /src/one/two.gleam:3:33 13 + ┌─ /src/one/two.gleam:3:34 14 14 15 15 3 │ pub fn main(box: Box(Int)) { box.unknown } 16 - │ ^^^^^^^^ Did you mean `inner`? 16 + │ ^^^^^^^ Did you mean `inner`? 17 17 18 18 The value being accessed has this type: 19 19
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__errors__unknown_record_field_2.snap
··· 9 9 10 10 ----- ERROR 11 11 error: Unknown record field 12 - ┌─ /src/one/two.gleam:3:44 12 + ┌─ /src/one/two.gleam:3:45 13 13 14 14 3 │ pub fn main(box: Box(Box(Int))) { box.inner.unknown } 15 - │ ^^^^^^^^ Did you mean `inner`? 15 + │ ^^^^^^^ Did you mean `inner`? 16 16 17 17 The value being accessed has this type: 18 18
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__imported_javascript_only_function.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unsupported target 18 - ┌─ /src/one/two.gleam:3:9 18 + ┌─ /src/one/two.gleam:3:10 19 19 20 20 3 │ module.javascript_only() 21 - │ ^^^^^^^^^^^^^^^^ 21 + │ ^^^^^^^^^^^^^^^ 22 22 23 23 This value is not available as it is defined using externals, and there is 24 24 no implementation for the Erlang target.
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__externals__javascript_only_constant.snap
··· 18 18 19 19 ----- ERROR 20 20 error: Unsupported target 21 - ┌─ /src/one/two.gleam:3:9 21 + ┌─ /src/one/two.gleam:3:10 22 22 23 23 3 │ module.javascript_only_constant() 24 - │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 24 + │ ^^^^^^^^^^^^^^^^^^^^^^^^ 25 25 26 26 This value is not available as it is defined using externals, and there is 27 27 no implementation for the Erlang target.
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_opaque_constructor.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown module value 18 - ┌─ /src/one/two.gleam:4:6 18 + ┌─ /src/one/two.gleam:4:7 19 19 20 20 4 │ one.Two 21 - │ ^^^^ 21 + │ ^^^ 22 22 23 23 one.Two is a type constructor, it cannot be used as a value
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_constructor.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown module value 18 - ┌─ /src/one/two.gleam:4:6 18 + ┌─ /src/one/two.gleam:4:7 19 19 20 20 4 │ one.Two 21 - │ ^^^^ 21 + │ ^^^ 22 22 23 23 The module `one` does not have a `Two` value.
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_custom_type.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown module value 18 - ┌─ /src/one/two.gleam:4:6 18 + ┌─ /src/one/two.gleam:4:7 19 19 20 20 4 │ one.X 21 - │ ^^ 21 + │ ^ 22 22 23 23 The module `one` does not have a `X` value.
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_external_type.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown module value 18 - ┌─ /src/one/two.gleam:4:6 18 + ┌─ /src/one/two.gleam:4:7 19 19 20 20 4 │ one.X 21 - │ ^^ 21 + │ ^ 22 22 23 23 The module `one` does not have a `X` value.
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_function.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown module value 18 - ┌─ /src/one/two.gleam:4:6 18 + ┌─ /src/one/two.gleam:4:7 19 19 20 20 4 │ one.two 21 - │ ^^^^ 21 + │ ^^^ 22 22 23 23 The module `one` does not have a `two` value.
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__imports__using_private_type_alias.snap
··· 15 15 16 16 ----- ERROR 17 17 error: Unknown module value 18 - ┌─ /src/one/two.gleam:4:6 18 + ┌─ /src/one/two.gleam:4:7 19 19 20 20 4 │ one.X 21 - │ ^^ 21 + │ ^ 22 22 23 23 The module `one` does not have a `X` value.
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_call_function.snap
··· 13 13 14 14 ----- WARNING 15 15 warning: Deprecated value used 16 - ┌─ /src/warning/wrn.gleam:5:9 16 + ┌─ /src/warning/wrn.gleam:5:10 17 17 18 18 5 │ module.a() 19 - │ ^^ This value has been deprecated 19 + │ ^ This value has been deprecated 20 20 21 21 It was deprecated with this message: Don't use this!
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_constant.snap
··· 13 13 14 14 ----- WARNING 15 15 warning: Deprecated value used 16 - ┌─ /src/warning/wrn.gleam:5:9 16 + ┌─ /src/warning/wrn.gleam:5:10 17 17 18 18 5 │ module.a 19 - │ ^^ This value has been deprecated 19 + │ ^ This value has been deprecated 20 20 21 21 It was deprecated with this message: Don't use this!
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__deprecated_imported_function.snap
··· 13 13 14 14 ----- WARNING 15 15 warning: Deprecated value used 16 - ┌─ /src/warning/wrn.gleam:5:9 16 + ┌─ /src/warning/wrn.gleam:5:10 17 17 18 18 5 │ module.a 19 - │ ^^ This value has been deprecated 19 + │ ^ This value has been deprecated 20 20 21 21 It was deprecated with this message: Don't use this!
+4 -4
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__record_access_variant_inference_requires_v1_6.snap
··· 19 19 20 20 ----- WARNING 21 21 warning: Incompatible gleam version range 22 - ┌─ /src/warning/wrn.gleam:9:25 22 + ┌─ /src/warning/wrn.gleam:9:26 23 23 24 24 9 │ Wibble(..) -> wibble.b 25 - │ ^^ This requires a Gleam version >= 1.6.0 25 + │ ^ This requires a Gleam version >= 1.6.0 26 26 27 27 Field access on custom types when the variant is known was introduced in 28 28 version v1.6.0. But the Gleam version range specified in your `gleam.toml` ··· 33 33 gleam = ">= 1.6.0" 34 34 35 35 warning: Incompatible gleam version range 36 - ┌─ /src/warning/wrn.gleam:10:25 36 + ┌─ /src/warning/wrn.gleam:10:26 37 37 38 38 10 │ Wobble(..) -> wibble.c 39 - │ ^^ This requires a Gleam version >= 1.6.0 39 + │ ^ This requires a Gleam version >= 1.6.0 40 40 41 41 Field access on custom types when the variant is known was introduced in 42 42 version v1.6.0. But the Gleam version range specified in your `gleam.toml`
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__unused_module_select_const.snap
··· 14 14 15 15 ----- WARNING 16 16 warning: Unused value 17 - ┌─ /src/warning/wrn.gleam:5:9 17 + ┌─ /src/warning/wrn.gleam:5:3 18 18 19 19 5 │ wibble.a 20 - │ ^^ This value is never used 20 + │ ^^^^^^^^ This value is never used
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__unused_module_select_constructor.snap
··· 14 14 15 15 ----- WARNING 16 16 warning: Unused value 17 - ┌─ /src/warning/wrn.gleam:5:9 17 + ┌─ /src/warning/wrn.gleam:5:3 18 18 19 19 5 │ wibble.Wibble 20 - │ ^^^^^^^ This value is never used 20 + │ ^^^^^^^^^^^^^ This value is never used
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__unused_module_select_function.snap
··· 14 14 15 15 ----- WARNING 16 16 warning: Unused value 17 - ┌─ /src/warning/wrn.gleam:5:9 17 + ┌─ /src/warning/wrn.gleam:5:3 18 18 19 19 5 │ wibble.println 20 - │ ^^^^^^^^ This value is never used 20 + │ ^^^^^^^^^^^^^^ This value is never used
+2 -2
compiler-core/src/type_/tests/snapshots/gleam_core__type___tests__warnings__unused_record_access_raises_a_warning.snap
··· 17 17 18 18 ----- WARNING 19 19 warning: Unused value 20 - ┌─ /src/warning/wrn.gleam:8:8 20 + ┌─ /src/warning/wrn.gleam:8:9 21 21 22 22 8 │ thing.value 23 - │ ^^^^^^ This value is never used 23 + │ ^^^^^ This value is never used
+4 -4
test-package-compiler/src/snapshots/test_package_compiler__generated_tests__opaque_type_accessor.snap
··· 3 3 expression: "./cases/opaque_type_accessor" 4 4 --- 5 5 error: Unknown record field 6 - ┌─ src/two.gleam:7:18 6 + ┌─ src/two.gleam:7:19 7 7 8 8 7 │ let name = user.name 9 - │ ^ This field does not exist 9 + │ ^ This field does not exist 10 10 11 11 The value being accessed has this type: 12 12 ··· 15 15 It does not have any fields. 16 16 17 17 error: Unknown record field 18 - ┌─ src/two.gleam:8:19 18 + ┌─ src/two.gleam:8:20 19 19 20 20 8 │ let score = user.score 21 - │ ^ This field does not exist 21 + │ ^ This field does not exist 22 22 23 23 The value being accessed has this type: 24 24
+2 -2
test-package-compiler/src/snapshots/test_package_compiler__generated_tests__unknown_module_field_in_expression.snap
··· 3 3 expression: "./cases/unknown_module_field_in_expression" 4 4 --- 5 5 error: Unknown module value 6 - ┌─ src/two.gleam:4:6 6 + ┌─ src/two.gleam:4:7 7 7 8 8 4 │ one.B 9 - │ ^ Did you mean `A`? 9 + │ ^ Did you mean `A`? 10 10 11 11 The module `one` does not have a `B` value.