-
Notifications
You must be signed in to change notification settings - Fork 484
super_errors: round two of error fixture coverage #8432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
30dde09
06505b0
d428a01
bb417af
efd21b7
46b9a97
92af7ba
8883005
fb56091
66253ff
36d1234
a0fc988
a3d619d
014aa81
f005778
729a9a2
2c247ec
7064605
7ccb84e
c7e5309
45be027
64696e3
3504be6
619a408
1db2ee9
13ade3b
f6f3973
3de9e9f
beb5c71
bb03634
5f96c00
75f37a5
edcd7c1
655251a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/access_functor_as_structure.res[0m:[2m9:8-10[0m | ||
|
|
||
| 7 [2m│[0m } | ||
| 8 [2m│[0m | ||
| [1;31m9[0m [2m│[0m let _: [1;31mF.v[0m = 1 | ||
| 10 [2m│[0m | ||
|
|
||
| The module F is a functor, not a structure |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/apply_generative.res[0m:[2m5:12[0m | ||
|
|
||
| 3 [2m│[0m } | ||
| 4 [2m│[0m | ||
| [1;31m5[0m [2m│[0m module M = [1;31mF[0m({ | ||
| 6 [2m│[0m let y = 2 | ||
| 7 [2m│[0m }) | ||
|
|
||
| This is a generative functor. It can only be applied to () |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/apply_non_function.res[0m:[2m3:9[0m | ||
|
|
||
| 1 [2m│[0m let x = 1 | ||
| 2 [2m│[0m | ||
| [1;31m3[0m [2m│[0m let y = [1;31mx[0m(2) | ||
| 4 [2m│[0m | ||
|
|
||
| This can't be called, it's not a function. | ||
| The function has type: int | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bad_immediate_attribute.res[0m:[2m2:1-15[0m | ||
|
|
||
| 1 [2m│[0m @immediate | ||
| [1;31m2[0m [2m│[0m [1;31mtype t = string[0m | ||
| 3 [2m│[0m | ||
|
|
||
| Types marked with the immediate attribute must be | ||
| non-pointer types like int or bool |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bad_unboxed_attribute_abstract.res[0m:[2m1:10-15[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m @unboxed [1;31mtype t[0m | ||
| 2 [2m│[0m | ||
|
|
||
| This type cannot be unboxed because it is abstract. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bad_unboxed_attribute_extensible.res[0m:[2m2:1-11[0m | ||
|
|
||
| 1 [2m│[0m @unboxed | ||
| [1;31m2[0m [2m│[0m [1;31mtype t = ..[0m | ||
| 3 [2m│[0m | ||
|
|
||
| This type cannot be unboxed because | ||
| extensible variant types cannot be unboxed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bad_unboxed_attribute_many_fields.res[0m:[2m2:1-25[0m | ||
|
|
||
| 1 [2m│[0m @unboxed | ||
| [1;31m2[0m [2m│[0m [1;31mtype t = {a: int, b: int}[0m | ||
| 3 [2m│[0m | ||
|
|
||
| This type cannot be unboxed because it has more than one field. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bad_unboxed_attribute_mutable.res[0m:[2m1:10-38[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m @unboxed [1;31mtype t = {mutable value: int}[0m | ||
| 2 [2m│[0m | ||
|
|
||
| This type cannot be unboxed because it is mutable. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bad_variance.res[0m:[2m1:1-24[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m [1;31mtype t<+'a> = 'a => unit[0m | ||
| 2 [2m│[0m | ||
|
|
||
| In this definition, expected parameter variances are not satisfied. | ||
| The 1st type parameter was expected to be covariant, | ||
| but it is injective contravariant. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bad_variance_contra.res[0m:[2m1:1-16[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m [1;31mtype t<-'a> = 'a[0m | ||
| 2 [2m│[0m | ||
|
|
||
| In this definition, expected parameter variances are not satisfied. | ||
| The 1st type parameter was expected to be contravariant, | ||
| but it is injective covariant. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/boxed_and_unboxed.res[0m:[2m2:1-17[0m | ||
|
|
||
| 1 [2m│[0m @unboxed @boxed | ||
| [1;31m2[0m [2m│[0m [1;31mtype t = One(int)[0m | ||
| 3 [2m│[0m | ||
|
|
||
| A type cannot be boxed and unboxed at the same time. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_conflict_attributes.res[0m:[2m1:21-24[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m external f: @string [1;31m@int[0m [#A | #B] => unit = "f" | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = f(#A) | ||
|
|
||
| conflicting attributes | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error message could be improved |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_expect_int_literal.res[0m:[2m1:19-21[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m external f: @int [[1;31m@as[0m("hello") #A | #B] => unit = "f" | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = f(#A) | ||
|
|
||
| expect int literal | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error message could be improved |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_expect_opt_in_bs_return_to_opt.res[0m:[2m1:1-2:31[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m [1;31m@return(null_to_opt)[0m | ||
| [1;31m2[0m [2m│[0m [1;31mexternal f: string => int = "f"[0m | ||
| 3 [2m│[0m | ||
| 4 [2m│[0m let _ = f("x") | ||
|
|
||
| %@return directive *_to_opt expect return type to be | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error message could be improved |
||
| syntax wise `_ option` for safety | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_expect_string_literal.res[0m:[2m1:22-24[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m external f: @string [[1;31m@as[0m(1) #A | #B] => unit = "f" | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = f(#A) | ||
|
|
||
| expect string literal |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_illegal_attribute_scope.res[0m:[2m1:1-6[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m [1;31m@scope[0m @val | ||
| 2 [2m│[0m external x: int = "x" | ||
| 3 [2m│[0m | ||
|
|
||
| Illegal attributes |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_invalid_bs_int_type.res[0m:[2m1:18-25[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m external f: @int [1;31m[#A(int)[0m] => unit = "f" | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = f(#A(1)) | ||
|
|
||
| Not a valid type for %@int |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_invalid_bs_string_type.res[0m:[2m1:21-33[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m external f: @string [1;31m[#A | #B(int)[0m] => unit = "f" | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = f(#A) | ||
|
|
||
| Not a valid type for %@string |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_invalid_bs_unwrap_type.res[0m:[2m1:21-23[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m external f: @unwrap [1;31mint[0m => unit = "f" | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = f(1) | ||
|
|
||
| Not a valid type for %@unwrap. Type must be an inline variant (closed), and | ||
| each constructor must have an argument. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/bs_not_supported_directive_in_bs_return.res[0m:[2m1:1-7[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m [1;31m@return[0m(bogus) | ||
| 2 [2m│[0m external f: string => int = "f" | ||
| 3 [2m│[0m | ||
|
|
||
| Not supported return directive |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/cannot_apply_non_functor.res[0m:[2m5:12[0m | ||
|
|
||
| 3 [2m│[0m } | ||
| 4 [2m│[0m | ||
| [1;31m5[0m [2m│[0m module N = [1;31mM[0m() | ||
| 6 [2m│[0m | ||
|
|
||
| This module is not a functor; it has type { | ||
| let x: int | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/cannot_extend_private_type.res[0m:[2m7:13[0m | ||
|
|
||
| 5 [2m│[0m } | ||
| 6 [2m│[0m | ||
| [1;31m7[0m [2m│[0m type M.t += [1;31mC[0m | ||
| 8 [2m│[0m | ||
|
|
||
| Cannot extend private type definition M.t |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/cannot_infer_signature.res[0m:[2m2:14-22[0m | ||
|
|
||
| 1 [2m│[0m let extract = m => { | ||
| [1;31m2[0m [2m│[0m module M = [1;31munpack(m)[0m | ||
| 3 [2m│[0m M | ||
| 4 [2m│[0m } | ||
|
|
||
| The signature for this packaged module couldn't be inferred. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/constraint_failed.res[0m:[2m3:14-19[0m | ||
|
|
||
| 1 [2m│[0m type t<'a> = 'a constraint 'a = int | ||
| 2 [2m│[0m | ||
| [1;31m3[0m [2m│[0m type bad = t<[1;31mstring[0m> | ||
| 4 [2m│[0m | ||
|
|
||
| This type string should be an instance of type int |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/constructor_arity_mismatch.res[0m:[2m5:9-15[0m | ||
|
|
||
| 3 [2m│[0m | Single(string) | ||
| 4 [2m│[0m | ||
| [1;31m5[0m [2m│[0m let x = [1;31mPair(1)[0m | ||
| 6 [2m│[0m | ||
| 7 [2m│[0m let y = Single(1, 2) | ||
|
|
||
| This variant constructor [1;33mPair[0m expects 2 arguments, but it's only being passed 1. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/constructor_arity_mismatch_pattern.res[0m:[2m5:5-11[0m | ||
|
|
||
| 3 [2m│[0m let f = x => | ||
| 4 [2m│[0m switch x { | ||
| [1;31m5[0m [2m│[0m | [1;31mPair(a)[0m => a | ||
| 6 [2m│[0m } | ||
| 7 [2m│[0m | ||
|
|
||
| This variant constructor [1;33mPair[0m expects 2 arguments, but it's only being passed 1. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/definition_mismatch.res[0m:[2m1:1-26[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m [1;31mtype t = list<int> = Empty[0m | ||
| 2 [2m│[0m | ||
|
|
||
| This variant or record definition does not match that of type list<int> | ||
| They have different arities. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/field_access_on_dict_type.res[0m:[2m3:11[0m | ||
|
|
||
| 1 [2m│[0m let d: dict<int> = dict{"a": 1} | ||
| 2 [2m│[0m | ||
| [1;31m3[0m [2m│[0m let v = d.[1;31ma[0m | ||
| 4 [2m│[0m | ||
|
|
||
| Direct field access on a dict is not supported. Use Dict.get instead. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
|
|
||
| [1;33mWarning number 8[0m | ||
| [36m/.../fixtures/fragile_pattern_toplevel.res[0m:[2m1:5-11[0m | ||
|
|
||
| [1;33m1[0m [2m│[0m let [1;33mSome(x)[0m = Some(1) | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = x | ||
|
|
||
| You forgot to handle a possible case here, for example: | ||
| | None | ||
|
|
||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/fragile_pattern_toplevel.res[0m:[2m1:5-11[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m let [1;31mSome(x)[0m = Some(1) | ||
| 2 [2m│[0m | ||
| 3 [2m│[0m let _ = x | ||
|
|
||
| Such fragile pattern not allowed in the toplevel |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
|
|
||
| [1;31mWe've found a bug for you![0m | ||
| [36m/.../fixtures/illegal_letrec_expr.res[0m:[2m1:13-17[0m | ||
|
|
||
| [1;31m1[0m [2m│[0m let rec x = [1;31mx + 1[0m | ||
| 2 [2m│[0m | ||
|
|
||
| This kind of expression is not allowed as right-hand side of `let rec' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last message sounds a bit strange actually.
Can be improved in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree, actually once we have full error coverage I want to do an audit of all messages and aim for improvements. For the purposes of these coverage PRs its just supposed to assert how things are right now.