Merge remote-tracking branch 'origin/main' into fix-try-eq

This commit is contained in:
Richard Feldman 2025-11-26 10:32:23 -05:00
commit d90b24cd27
No known key found for this signature in database
37 changed files with 285 additions and 68 deletions

View file

@ -1660,10 +1660,8 @@ pub const ReportBuilder = struct {
const region_info = self.module_env.calcRegionInfo(region.*); const region_info = self.module_env.calcRegionInfo(region.*);
try report.document.addReflowingText("This "); try report.document.addReflowingText("This ");
try report.document.addAnnotated(method_name_str, .inline_code); try report.document.addAnnotated(method_name_str, .emphasized);
try report.document.addReflowingText(" method is being called on the type "); try report.document.addReflowingText(" method is being called on a value whose type doesn't have that method:");
try report.document.addAnnotated(snapshot_str, .type_variable);
try report.document.addReflowingText(", which has no method with that name:");
try report.document.addLineBreak(); try report.document.addLineBreak();
try report.document.addSourceRegion( try report.document.addSourceRegion(
@ -1675,6 +1673,15 @@ pub const ReportBuilder = struct {
); );
try report.document.addLineBreak(); try report.document.addLineBreak();
try report.document.addReflowingText("The value's type, which does not have a method named ");
try report.document.addAnnotated(method_name_str, .emphasized);
try report.document.addReflowingText(", is:");
try report.document.addLineBreak();
try report.document.addLineBreak();
try report.document.addText(" ");
try report.document.addAnnotated(snapshot_str, .type_variable);
try report.document.addLineBreak();
return report; return report;
} }
@ -1704,19 +1711,16 @@ pub const ReportBuilder = struct {
if (is_plus_operator) { if (is_plus_operator) {
try report.document.addReflowingText("The value before this "); try report.document.addReflowingText("The value before this ");
try report.document.addAnnotated("+", .emphasized); try report.document.addAnnotated("+", .emphasized);
try report.document.addReflowingText(" operator has the type "); try report.document.addReflowingText(" operator has a type that doesn't have a ");
try report.document.addAnnotated(snapshot_str, .emphasized);
try report.document.addReflowingText(", which has no ");
try report.document.addAnnotated(method_name_str, .emphasized); try report.document.addAnnotated(method_name_str, .emphasized);
try report.document.addReflowingText(" method:"); try report.document.addReflowingText(" method:");
try report.document.addLineBreak();
} else { } else {
try report.document.addReflowingText("This "); try report.document.addReflowingText("This ");
try report.document.addAnnotated(method_name_str, .emphasized); try report.document.addAnnotated(method_name_str, .emphasized);
try report.document.addReflowingText(" method is being called on the type "); try report.document.addReflowingText(" method is being called on a value whose type doesn't have that method:");
try report.document.addAnnotated(snapshot_str, .emphasized);
try report.document.addReflowingText(", which has no method with that name:");
}
try report.document.addLineBreak(); try report.document.addLineBreak();
}
try report.document.addSourceRegion( try report.document.addSourceRegion(
region_info, region_info,
@ -1725,6 +1729,21 @@ pub const ReportBuilder = struct {
self.source, self.source,
self.module_env.getLineStarts(), self.module_env.getLineStarts(),
); );
try report.document.addLineBreak();
if (is_plus_operator) {
try report.document.addReflowingText("The value's type, which does not have a method named ");
try report.document.addAnnotated(method_name_str, .emphasized);
try report.document.addReflowingText(", is:");
} else {
try report.document.addReflowingText("The value's type, which does not have a method named ");
try report.document.addAnnotated(method_name_str, .emphasized);
try report.document.addReflowingText(", is:");
}
try report.document.addLineBreak();
try report.document.addLineBreak();
try report.document.addText(" ");
try report.document.addAnnotated(snapshot_str, .type_variable);
// TODO: Find similar method names and show a more helpful error message // TODO: Find similar method names and show a more helpful error message
// here // here

View file

@ -107,7 +107,8 @@ pub const LinkError = error{
OutOfMemory, OutOfMemory,
InvalidArguments, InvalidArguments,
LLVMNotAvailable, LLVMNotAvailable,
}; WindowsSDKNotFound,
} || std.zig.system.DetectError;
/// Link object files into an executable using LLD /// Link object files into an executable using LLD
pub fn link(allocs: *Allocators, config: LinkConfig) LinkError!void { pub fn link(allocs: *Allocators, config: LinkConfig) LinkError!void {
@ -216,6 +217,35 @@ pub fn link(allocs: *Allocators, config: LinkConfig) LinkError!void {
// Add linker name for Windows COFF // Add linker name for Windows COFF
try args.append("lld-link"); try args.append("lld-link");
const query = std.Target.Query{
.cpu_arch = target_arch,
.os_tag = .windows,
.abi = .msvc,
.ofmt = .coff,
};
const target = try std.zig.system.resolveTargetQuery(query);
const native_libc = std.zig.LibCInstallation.findNative(.{
.allocator = allocs.arena,
.target = &target,
}) catch return error.WindowsSDKNotFound;
if (native_libc.crt_dir) |lib_dir| {
const lib_arg = try std.fmt.allocPrint(allocs.arena, "/libpath:{s}", .{lib_dir});
try args.append(lib_arg);
} else return error.WindowsSDKNotFound;
if (native_libc.msvc_lib_dir) |lib_dir| {
const lib_arg = try std.fmt.allocPrint(allocs.arena, "/libpath:{s}", .{lib_dir});
try args.append(lib_arg);
} else return error.WindowsSDKNotFound;
if (native_libc.kernel32_lib_dir) |lib_dir| {
const lib_arg = try std.fmt.allocPrint(allocs.arena, "/libpath:{s}", .{lib_dir});
try args.append(lib_arg);
} else return error.WindowsSDKNotFound;
// Add output argument using Windows style // Add output argument using Windows style
const out_arg = try std.fmt.allocPrint(allocs.arena, "/out:{s}", .{config.output_path}); const out_arg = try std.fmt.allocPrint(allocs.arena, "/out:{s}", .{config.output_path});
try args.append(out_arg); try args.append(out_arg);

View file

@ -50,13 +50,16 @@ But the type annotation says it should have the type:
_Pair(U8)_ _Pair(U8)_
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**annotations.md:16:33:16:34:** **annotations.md:16:33:16:34:**
```roc ```roc
failPairDiffTypes = mkPair("1", 2) failPairDiffTypes = mkPair("1", 2)
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
@ -75,13 +78,16 @@ But the type annotation says it should have the type:
_Pair(U64)_ _Pair(U64)_
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**annotations.md:19:32:19:33:** **annotations.md:19:32:19:33:**
```roc ```roc
failPairDiffTypes2 = Pair.Pair(1, "str") failPairDiffTypes2 = Pair.Pair(1, "str")
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -29,13 +29,16 @@ This feature is not yet implemented: unsupported operator
This error doesn't have a proper diagnostic report yet. Let us know if you want to help improve Roc's error messages! This error doesn't have a proper diagnostic report yet. Let us know if you want to help improve Roc's error messages!
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Bool**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**binop_omnibus__single__no_spaces.md:1:32:1:34:** **binop_omnibus__single__no_spaces.md:1:32:1:34:**
```roc ```roc
Err(foo)??12>5*5 or 13+2<5 and 10-1>=16 or 12<=3/5 Err(foo)??12>5*5 or 13+2<5 and 10-1>=16 or 12<=3/5
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_Bool_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -12,24 +12,30 @@ MISSING METHOD - can_list_first_concrete.md:1:2:1:4
MISSING METHOD - can_list_first_concrete.md:1:15:1:19 MISSING METHOD - can_list_first_concrete.md:1:15:1:19
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_first_concrete.md:1:2:1:4:** **can_list_first_concrete.md:1:2:1:4:**
```roc ```roc
[42, "world", 3.14] [42, "world", 3.14]
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_first_concrete.md:1:15:1:19:** **can_list_first_concrete.md:1:15:1:19:**
```roc ```roc
[42, "world", 3.14] [42, "world", 3.14]
``` ```
^^^^ ^^^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -12,24 +12,30 @@ MISSING METHOD - can_list_heterogeneous.md:1:2:1:3
MISSING METHOD - can_list_heterogeneous.md:1:14:1:18 MISSING METHOD - can_list_heterogeneous.md:1:14:1:18
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_heterogeneous.md:1:2:1:3:** **can_list_heterogeneous.md:1:2:1:3:**
```roc ```roc
[1, "hello", 3.14] [1, "hello", 3.14]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_heterogeneous.md:1:14:1:18:** **can_list_heterogeneous.md:1:14:1:18:**
```roc ```roc
[1, "hello", 3.14] [1, "hello", 3.14]
``` ```
^^^^ ^^^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -32,24 +32,30 @@ Note: You can wrap each element in a tag to make them compatible.
To learn about tags, see <https://www.roc-lang.org/tutorial#tags> To learn about tags, see <https://www.roc-lang.org/tutorial#tags>
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_mismatch_then_nested_error.md:1:2:1:3:** **can_list_mismatch_then_nested_error.md:1:2:1:3:**
```roc ```roc
[1, "hello", [3, "world"]] [1, "hello", [3, "world"]]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_mismatch_then_nested_error.md:1:15:1:16:** **can_list_mismatch_then_nested_error.md:1:15:1:16:**
```roc ```roc
[1, "hello", [3, "world"]] [1, "hello", [3, "world"]]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -16,24 +16,30 @@ MISSING METHOD - can_list_multiline_mismatch.md:2:5:2:7
MISSING METHOD - can_list_multiline_mismatch.md:4:5:4:8 MISSING METHOD - can_list_multiline_mismatch.md:4:5:4:8
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_multiline_mismatch.md:2:5:2:7:** **can_list_multiline_mismatch.md:2:5:2:7:**
```roc ```roc
42, 42,
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_multiline_mismatch.md:4:5:4:8:** **can_list_multiline_mismatch.md:4:5:4:8:**
```roc ```roc
100 100
``` ```
^^^ ^^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -11,13 +11,16 @@ type=expr
MISSING METHOD - can_list_nested_heterogeneous.md:1:7:1:8 MISSING METHOD - can_list_nested_heterogeneous.md:1:7:1:8
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_nested_heterogeneous.md:1:7:1:8:** **can_list_nested_heterogeneous.md:1:7:1:8:**
```roc ```roc
[[], [1], ["hello"]] [[], [1], ["hello"]]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -11,13 +11,16 @@ type=expr
MISSING METHOD - can_list_triple_nested_heterogeneous.md:1:12:1:13 MISSING METHOD - can_list_triple_nested_heterogeneous.md:1:12:1:13
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_triple_nested_heterogeneous.md:1:12:1:13:** **can_list_triple_nested_heterogeneous.md:1:12:1:13:**
```roc ```roc
[[], [[], [1]], [[], ["hello"]]] [[], [[], [1]], [[], ["hello"]]]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -11,13 +11,16 @@ type=expr
MISSING METHOD - can_list_two_elements.md:1:2:1:3 MISSING METHOD - can_list_two_elements.md:1:2:1:3
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_list_two_elements.md:1:2:1:3:** **can_list_two_elements.md:1:2:1:3:**
```roc ```roc
[1, "hello"] [1, "hello"]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -12,24 +12,30 @@ MISSING METHOD - can_nested_heterogeneous_lists.md:1:3:1:4
MISSING METHOD - can_nested_heterogeneous_lists.md:1:20:1:21 MISSING METHOD - can_nested_heterogeneous_lists.md:1:20:1:21
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_nested_heterogeneous_lists.md:1:3:1:4:** **can_nested_heterogeneous_lists.md:1:3:1:4:**
```roc ```roc
[[1, "hello"], [2, 3]] [[1, "hello"], [2, 3]]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**can_nested_heterogeneous_lists.md:1:20:1:21:** **can_nested_heterogeneous_lists.md:1:20:1:21:**
```roc ```roc
[[1, "hello"], [2, 3]] [[1, "hello"], [2, 3]]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -11,13 +11,16 @@ x = 12.34()
MISSING METHOD - call_float_literal.md:1:5:1:10 MISSING METHOD - call_float_literal.md:1:5:1:10
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _({}) -> _ret_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**call_float_literal.md:1:5:1:10:** **call_float_literal.md:1:5:1:10:**
```roc ```roc
x = 12.34() x = 12.34()
``` ```
^^^^^ ^^^^^
The value's type, which does not have a method named **from_numeral**, is:
_({}) -> _ret_
# TOKENS # TOKENS

View file

@ -11,13 +11,16 @@ type=expr
MISSING METHOD - list_type_err.md:1:5:1:6 MISSING METHOD - list_type_err.md:1:5:1:6
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**list_type_err.md:1:5:1:6:** **list_type_err.md:1:5:1:6:**
```roc ```roc
[1, 2, "hello"] [1, 2, "hello"]
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -22,13 +22,16 @@ type=expr
MISSING METHOD - tag_applications_simple.md:2:10:2:12 MISSING METHOD - tag_applications_simple.md:2:10:2:12
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _[Ok([Just(a)]_others)]_others2 where [a.from_numeral : Numeral -> Try(_b, [InvalidNumeral(Str)])]_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**tag_applications_simple.md:2:10:2:12:** **tag_applications_simple.md:2:10:2:12:**
```roc ```roc
Some(42), Some(42),
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_[Ok([Just(a)]_others)]_others2 where [a.from_numeral : Numeral -> Try(_b, [InvalidNumeral(Str)])]_
# TOKENS # TOKENS

View file

@ -17,24 +17,30 @@ MISSING METHOD - tuple_type.md:5:8:5:9
MISSING METHOD - tuple_type.md:5:11:5:12 MISSING METHOD - tuple_type.md:5:11:5:12
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**tuple_type.md:5:8:5:9:** **tuple_type.md:5:8:5:9:**
```roc ```roc
f((1, 2)) f((1, 2))
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**tuple_type.md:5:11:5:12:** **tuple_type.md:5:11:5:12:**
```roc ```roc
f((1, 2)) f((1, 2))
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -23,13 +23,16 @@ foo = if tru 0
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _{}_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**expr_if_missing_else.md:1:14:1:15:** **expr_if_missing_else.md:1:14:1:15:**
```roc ```roc
foo = if tru 0 foo = if tru 0
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_{}_
# TOKENS # TOKENS

View file

@ -31,34 +31,43 @@ if bool {
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Bool**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**if_then_else_9.md:3:11:3:13:** **if_then_else_9.md:3:11:3:13:**
```roc ```roc
} else if 10 { # Comment after else open } else if 10 { # Comment after else open
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_Bool_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _[A]_others_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**if_then_else_9.md:2:2:2:3:** **if_then_else_9.md:2:2:2:3:**
```roc ```roc
1 1
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_[A]_others_
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _[A]_others_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**if_then_else_9.md:6:2:6:3:** **if_then_else_9.md:6:2:6:3:**
```roc ```roc
3 3
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_[A]_others_
# TOKENS # TOKENS

View file

@ -25,13 +25,16 @@ if bool {
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _[A]_others_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**if_then_else_simple_block_formatting.md:3:8:3:9:** **if_then_else_simple_block_formatting.md:3:8:3:9:**
```roc ```roc
} else 2 } else 2
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_[A]_others_
# TOKENS # TOKENS

View file

@ -39,13 +39,16 @@ Note: You can wrap branches in a tag to make them compatible.
To learn about tags, see <https://www.roc-lang.org/tutorial#tags> To learn about tags, see <https://www.roc-lang.org/tutorial#tags>
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Bool**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**if_then_else_simple_file.md:1:10:1:11:** **if_then_else_simple_file.md:1:10:1:11:**
```roc ```roc
foo = if 1 A foo = if 1 A
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Bool_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -26,13 +26,16 @@ BadType := _
Underscores in type annotations mean "I don't care about this type", which doesn't make sense when declaring a type. If you need a placeholder type variable, use a named type variable like `a` instead. Underscores in type annotations mean "I don't care about this type", which doesn't make sense when declaring a type. If you need a placeholder type variable, use a named type variable like `a` instead.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **BadType**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**simple_underscore_error.md:4:7:4:9:** **simple_underscore_error.md:4:7:4:9:**
```roc ```roc
foo = 42 foo = 42
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_BadType_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -122,13 +122,16 @@ BadTuple := (_, U32)
Underscores in type annotations mean "I don't care about this type", which doesn't make sense when declaring a type. If you need a placeholder type variable, use a named type variable like `a` instead. Underscores in type annotations mean "I don't care about this type", which doesn't make sense when declaring a type. If you need a placeholder type variable, use a named type variable like `a` instead.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **BadType**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**underscore_error_type.md:4:7:4:9:** **underscore_error_type.md:4:7:4:9:**
```roc ```roc
foo = 42 foo = 42
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_BadType_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -40,13 +40,16 @@ UnusedType := _
Underscores in type annotations mean "I don't care about this type", which doesn't make sense when declaring a type. If you need a placeholder type variable, use a named type variable like `a` instead. Underscores in type annotations mean "I don't care about this type", which doesn't make sense when declaring a type. If you need a placeholder type variable, use a named type variable like `a` instead.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **UsedType**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**usage_test.md:6:9:6:11:** **usage_test.md:6:9:6:11:**
```roc ```roc
value = 42 value = 42
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_UsedType_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -18,13 +18,16 @@ MISSING METHOD - lambda_annotation_mismatch_error.md:3:23:3:29
+ - :0:0:0:0 + - :0:0:0:0
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
The value before this **+** operator has the type **Str**, which has no **plus** method: The value before this **+** operator has a type that doesn't have a **plus** method:
**lambda_annotation_mismatch_error.md:3:23:3:29:** **lambda_annotation_mismatch_error.md:3:23:3:29:**
```roc ```roc
string_function = |x| x + 42 string_function = |x| x + 42
``` ```
^^^^^^ ^^^^^^
The value's type, which does not have a method named **plus**, is:
_Str_
**Hint: **The **+** operator calls a method named **plus** on the value preceding it, passing the value after the operator as the one argument. **Hint: **The **+** operator calls a method named **plus** on the value preceding it, passing the value after the operator as the one argument.

View file

@ -91,24 +91,30 @@ But the seventh argument has the type:
`multi_arg_fn` needs these arguments to have compatible types. `multi_arg_fn` needs these arguments to have compatible types.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**lambda_multi_arg_mismatch.md:9:5:9:7:** **lambda_multi_arg_mismatch.md:9:5:9:7:**
```roc ```roc
42, # x1: U64 (type 'a') 42, # x1: U64 (type 'a')
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**lambda_multi_arg_mismatch.md:13:5:13:9:** **lambda_multi_arg_mismatch.md:13:5:13:9:**
```roc ```roc
3.14, # x5: F64 (should be 'a' = U64) - MISMATCH 3.14, # x5: F64 (should be 'a' = U64) - MISMATCH
``` ```
^^^^ ^^^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -11,13 +11,16 @@ type=expr
MISSING METHOD - let_polymorphism_error.md:1:6:1:9 MISSING METHOD - let_polymorphism_error.md:1:6:1:9
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**let_polymorphism_error.md:1:6:1:9:** **let_polymorphism_error.md:1:6:1:9:**
```roc ```roc
[42, 4.2, "hello"] [42, 4.2, "hello"]
``` ```
^^^ ^^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -54,13 +54,16 @@ UNUSED VALUE - let_polymorphism_records.md:38:2:38:17
MISSING METHOD - let_polymorphism_records.md:38:2:38:3 MISSING METHOD - let_polymorphism_records.md:38:2:38:3
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**let_polymorphism_records.md:26:47:26:49:** **let_polymorphism_records.md:26:47:26:49:**
```roc ```roc
updated_mismatch = update_data(str_container, 99) updated_mismatch = update_data(str_container, 99)
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
@ -76,13 +79,16 @@ It has the type:
_{ ..a, data: b }, b -> { ..a, data: b }_ _{ ..a, data: b }, b -> { ..a, data: b }_
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _{ ..a, data: b }, b -> { ..a, data: b }_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**let_polymorphism_records.md:38:2:38:3:** **let_polymorphism_records.md:38:2:38:3:**
```roc ```roc
1 + update_data 1 + update_data
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_{ ..a, data: b }, b -> { ..a, data: b }_
# TOKENS # TOKENS

View file

@ -27,13 +27,16 @@ match color {
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**basic_tag_union.md:3:10:3:11:** **basic_tag_union.md:3:10:3:11:**
```roc ```roc
Blue => 2 Blue => 2
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -19,45 +19,57 @@ MISSING METHOD - literal_patterns.md:5:5:5:7
MISSING METHOD - literal_patterns.md:5:11:5:12 MISSING METHOD - literal_patterns.md:5:11:5:12
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**literal_patterns.md:2:15:2:16:** **literal_patterns.md:2:15:2:16:**
```roc ```roc
Answer => 1 Answer => 1
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**literal_patterns.md:4:17:4:18:** **literal_patterns.md:4:17:4:18:**
```roc ```roc
Greeting => 3 Greeting => 3
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This `from_numeral` method is being called on the type _[Answer, Zero, Greeting]_others_, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**literal_patterns.md:5:5:5:7:** **literal_patterns.md:5:5:5:7:**
```roc ```roc
10 => 4 10 => 4
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_[Answer, Zero, Greeting]_others_
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**literal_patterns.md:5:11:5:12:** **literal_patterns.md:5:11:5:12:**
```roc ```roc
10 => 4 10 => 4
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -44,13 +44,16 @@ All patterns in an `match` must have compatible types.
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**pattern_alternatives_mixed.md:2:10:2:11:** **pattern_alternatives_mixed.md:2:10:2:11:**
```roc ```roc
1 | 2 | 3 => "small numbers" 1 | 2 | 3 => "small numbers"
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -72,13 +72,16 @@ But I expected it to be:
_Bool_ _Bool_
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**multiline_string_complex.md:37:3:37:4:** **multiline_string_complex.md:37:3:37:4:**
```roc ```roc
0 - \\ 0 - \\
``` ```
^ ^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -210,24 +210,30 @@ It's referenced here:
**MISSING METHOD** **MISSING METHOD**
This **to_frac** method is being called on the type **U8**, which has no method with that name: This **to_frac** method is being called on a value whose type doesn't have that method:
**Color.md:22:17:22:24:** **Color.md:22:17:22:24:**
```roc ```roc
rounded = a.to_frac() / 255.0 rounded = a.to_frac() / 255.0
``` ```
^^^^^^^ ^^^^^^^
The value's type, which does not have a method named **to_frac**, is:
_U8_
**Hint: **For this to work, the type would need to have a method named **to_frac** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **to_frac** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **to_utf8** method is being called on the type **Str**, which has no method with that name: This **to_utf8** method is being called on a value whose type doesn't have that method:
**Color.md:29:17:29:24:** **Color.md:29:17:29:24:**
```roc ```roc
bytes = str.to_utf8() bytes = str.to_utf8()
``` ```
^^^^^^^ ^^^^^^^
The value's type, which does not have a method named **to_utf8**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **to_utf8** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **to_utf8** associated with it in the type's declaration.
@ -258,35 +264,44 @@ But the type annotation says it should have the type:
_Try(Color, [InvalidHex(Str)])_ _Try(Color, [InvalidHex(Str)])_
**MISSING METHOD** **MISSING METHOD**
This **is_named_color** method is being called on the type **Str**, which has no method with that name: This **is_named_color** method is being called on a value whose type doesn't have that method:
**Color.md:62:12:62:26:** **Color.md:62:12:62:26:**
```roc ```roc
if str.is_named_color() if str.is_named_color()
``` ```
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
The value's type, which does not have a method named **is_named_color**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **is_named_color** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **is_named_color** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **to_str** method is being called on the type **Color**, which has no method with that name: This **to_str** method is being called on a value whose type doesn't have that method:
**Color.md:56:26:56:32:** **Color.md:56:26:56:32:**
```roc ```roc
expect rgb(124, 56, 245).to_str() == "rgb(124, 56, 245)" expect rgb(124, 56, 245).to_str() == "rgb(124, 56, 245)"
``` ```
^^^^^^ ^^^^^^
The value's type, which does not have a method named **to_str**, is:
_Color_
**Hint: **For this to work, the type would need to have a method named **to_str** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **to_str** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **to_str** method is being called on the type **Color**, which has no method with that name: This **to_str** method is being called on a value whose type doesn't have that method:
**Color.md:57:32:57:38:** **Color.md:57:32:57:38:**
```roc ```roc
expect rgba(124, 56, 245, 255).to_str() == "rgba(124, 56, 245, 1.0)" expect rgba(124, 56, 245, 255).to_str() == "rgba(124, 56, 245, 1.0)"
``` ```
^^^^^^ ^^^^^^
The value's type, which does not have a method named **to_str**, is:
_Color_
**Hint: **For this to work, the type would need to have a method named **to_str** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **to_str** associated with it in the type's declaration.

View file

@ -17,13 +17,16 @@ type=expr
MISSING METHOD - polymorphism.md:6:29:6:35 MISSING METHOD - polymorphism.md:6:29:6:35
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This `to_str` method is being called on the type _{ first: a, first: Str, first: [True]b, pair1: { first: a, second: Str }, pair2: { first: Str, second: c }, pair3: { first: [True]b, second: [False]d }, second: Str, second: c, second: [False]d } where [a.from_numeral : Numeral -> Try(_e, [InvalidNumeral(Str)]), c.from_numeral : Numeral -> Try(_f, [InvalidNumeral(Str)])]_, which has no method with that name: This **to_str** method is being called on a value whose type doesn't have that method:
**polymorphism.md:6:29:6:35:** **polymorphism.md:6:29:6:35:**
```roc ```roc
{ pair1, pair2, pair3 }.to_str() { pair1, pair2, pair3 }.to_str()
``` ```
^^^^^^ ^^^^^^
The value's type, which does not have a method named **to_str**, is:
_{ first: a, first: Str, first: [True]b, pair1: { first: a, second: Str }, pair2: { first: Str, second: c }, pair3: { first: [True]b, second: [False]d }, second: Str, second: c, second: [False]d } where [a.from_numeral : Numeral -> Try(_e, [InvalidNumeral(Str)]), c.from_numeral : Numeral -> Try(_f, [InvalidNumeral(Str)])]_
# TOKENS # TOKENS

View file

@ -49,35 +49,44 @@ MISSING METHOD - Adv.md:23:17:23:28
MISSING METHOD - Adv.md:28:21:28:27 MISSING METHOD - Adv.md:28:21:28:27
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**Adv.md:17:28:17:31:** **Adv.md:17:28:17:31:**
```roc ```roc
next_val = val.update_str(100) next_val = val.update_str(100)
``` ```
^^^ ^^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **update_strr** method is being called on the type **Adv**, which has no method with that name: This **update_strr** method is being called on a value whose type doesn't have that method:
**Adv.md:23:17:23:28:** **Adv.md:23:17:23:28:**
```roc ```roc
next_val = val.update_strr(100) next_val = val.update_strr(100)
``` ```
^^^^^^^^^^^ ^^^^^^^^^^^
The value's type, which does not have a method named **update_strr**, is:
_Adv_
**Hint: **For this to work, the type would need to have a method named **update_strr** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **update_strr** associated with it in the type's declaration.
**MISSING METHOD** **MISSING METHOD**
This **update** method is being called on the type **Str**, which has no method with that name: This **update** method is being called on a value whose type doesn't have that method:
**Adv.md:28:21:28:27:** **Adv.md:28:21:28:27:**
```roc ```roc
next_val = "Hello".update(100) next_val = "Hello".update(100)
``` ```
^^^^^^ ^^^^^^
The value's type, which does not have a method named **update**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **update** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **update** associated with it in the type's declaration.

View file

@ -27,24 +27,30 @@ MISSING METHOD - plus_operator_vs_method.md:11:11:11:16
MISSING METHOD - plus_operator_vs_method.md:15:13:15:17 MISSING METHOD - plus_operator_vs_method.md:15:13:15:17
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
The value before this **+** operator has the type **MyType**, which has no **plus** method: The value before this **+** operator has a type that doesn't have a **plus** method:
**plus_operator_vs_method.md:11:11:11:16:** **plus_operator_vs_method.md:11:11:11:16:**
```roc ```roc
result1 = a + b result1 = a + b
``` ```
^^^^^ ^^^^^
The value's type, which does not have a method named **plus**, is:
_MyType_
**Hint: **The **+** operator calls a method named **plus** on the value preceding it, passing the value after the operator as the one argument. **Hint: **The **+** operator calls a method named **plus** on the value preceding it, passing the value after the operator as the one argument.
**MISSING METHOD** **MISSING METHOD**
This **plus** method is being called on the type **MyType**, which has no method with that name: This **plus** method is being called on a value whose type doesn't have that method:
**plus_operator_vs_method.md:15:13:15:17:** **plus_operator_vs_method.md:15:13:15:17:**
```roc ```roc
result2 = a.plus(b) result2 = a.plus(b)
``` ```
^^^^ ^^^^
The value's type, which does not have a method named **plus**, is:
_MyType_
**Hint: **For this to work, the type would need to have a method named **plus** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **plus** associated with it in the type's declaration.

View file

@ -16,13 +16,16 @@ type=expr
MISSING METHOD - test_instantiated_arg_mismatch.md:5:10:5:12 MISSING METHOD - test_instantiated_arg_mismatch.md:5:10:5:12
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **Str**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**test_instantiated_arg_mismatch.md:5:10:5:12:** **test_instantiated_arg_mismatch.md:5:10:5:12:**
```roc ```roc
pair(42, "hello") pair(42, "hello")
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_Str_
**Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration. **Hint: **For this to work, the type would need to have a method named **from_numeral** associated with it in the type's declaration.

View file

@ -26,13 +26,16 @@ main! = |_| {}
MISSING METHOD - type_var_mismatch.md:7:9:7:11 MISSING METHOD - type_var_mismatch.md:7:9:7:11
# PROBLEMS # PROBLEMS
**MISSING METHOD** **MISSING METHOD**
This **from_numeral** method is being called on the type **item**, which has no method with that name: This **from_numeral** method is being called on a value whose type doesn't have that method:
**type_var_mismatch.md:7:9:7:11:** **type_var_mismatch.md:7:9:7:11:**
```roc ```roc
item = 42 item = 42
``` ```
^^ ^^
The value's type, which does not have a method named **from_numeral**, is:
_item_
**Hint: ** Did you forget to specify **from_numeral** in the type annotation? **Hint: ** Did you forget to specify **from_numeral** in the type annotation?