diff --git a/src/check/problem.zig b/src/check/problem.zig index 4fe1a6ea15..6589654361 100644 --- a/src/check/problem.zig +++ b/src/check/problem.zig @@ -1696,15 +1696,17 @@ pub const ReportBuilder = struct { if (is_plus_operator) { try report.document.addReflowingText("The value before this "); try report.document.addAnnotated("+", .emphasized); - try report.document.addReflowingText(" operator has a type with no "); + try report.document.addReflowingText(" operator has the type "); + 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.addReflowingText(" method:"); } else { - try report.document.addReflowingText("The "); - try report.document.addAnnotated(snapshot_str, .emphasized); - try report.document.addReflowingText(" type does not have a "); + try report.document.addReflowingText("This "); try report.document.addAnnotated(method_name_str, .emphasized); - try report.document.addReflowingText(" method:"); + try report.document.addReflowingText(" method is being called on the type "); + try report.document.addAnnotated(snapshot_str, .emphasized); + try report.document.addReflowingText(", which has no method with that name:"); } try report.document.addLineBreak(); diff --git a/test/snapshots/static_dispatch/Adv.md b/test/snapshots/static_dispatch/Adv.md index 41511d3a00..7ecc8629d5 100644 --- a/test/snapshots/static_dispatch/Adv.md +++ b/test/snapshots/static_dispatch/Adv.md @@ -63,7 +63,7 @@ But I expected it to be: _Adv, Str -> Adv_ **MISSING METHOD** -The **Adv** type does not have a **update_strr** method: +This **update_strr** method is being called on the type **Adv**, which has no method with that name: **Adv.md:23:13:23:33:** ```roc next_val = val.update_strr(100) diff --git a/test/snapshots/static_dispatch/plus_operator_vs_method.md b/test/snapshots/static_dispatch/plus_operator_vs_method.md index ab676bc160..7463adcb93 100644 --- a/test/snapshots/static_dispatch/plus_operator_vs_method.md +++ b/test/snapshots/static_dispatch/plus_operator_vs_method.md @@ -27,7 +27,7 @@ MISSING METHOD - plus_operator_vs_method.md:11:11:11:16 MISSING METHOD - plus_operator_vs_method.md:15:11:15:20 # PROBLEMS **MISSING METHOD** -The value before this **+** operator has a type with no **plus** method: +The value before this **+** operator has the type **MyType**, which has no **plus** method: **plus_operator_vs_method.md:11:11:11:16:** ```roc result1 = a + b @@ -38,7 +38,7 @@ result1 = a + b **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** -The **MyType** type does not have a **plus** method: +This **plus** method is being called on the type **MyType**, which has no method with that name: **plus_operator_vs_method.md:15:11:15:20:** ```roc result2 = a.plus(b)