Skip to content

Commit 077b122

Browse files
committed
More tests
1 parent e5e0dce commit 077b122

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

tests/lean/run/idSuggestStandalone.lean

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ error: Invalid field `test0`: The environment does not contain `String.test0`, s
2323
of type `String`
2424
2525
Hint: Perhaps you meant `String.foo` in place of `String.test0`:
26-
"abc".t̵e̵s̵t̵0̵f̲o̲o̲
26+
.t̵e̵s̵t̵0̵f̲o̲o̲
2727
-/
2828
#guard_msgs in
2929
#check "abc".test0
@@ -44,8 +44,8 @@ error: Invalid field `test1`: The environment does not contain `String.test1`, s
4444
of type `String`
4545
4646
Hint: Perhaps you meant one of these in place of `String.test1`:
47-
[apply] `String.foo`: "abc".foo
48-
[apply] `String.baz`: "abc".baz
47+
[apply] `String.foo`
48+
[apply] `String.baz`
4949
-/
5050
#guard_msgs in
5151
#check "abc".test1
@@ -67,9 +67,9 @@ error: Invalid field `test2`: The environment does not contain `String.test2`, s
6767
of type `String`
6868
6969
Hint: Perhaps you meant one of these in place of `String.test2`:
70-
[apply] `String.foo`: "abc".foo
71-
[apply] `String.baz`: "abc".baz
72-
[apply] `String.bar`: "abc".bar
70+
[apply] `String.foo`
71+
[apply] `String.baz`
72+
[apply] `String.bar`
7373
-/
7474
#guard_msgs in
7575
#check "abc".test2
@@ -119,7 +119,7 @@ error: Invalid field `toNum`: The environment does not contain `Foo.Bar.toNum`,
119119
of type `Foo.Bar`
120120
121121
Hint: Perhaps you meant `Foo.Bar.toNat` in place of `Foo.Bar.toNum`:
122-
Foo.Bar.three.t̵o̵N̵u̵m̵t̲o̲N̲a̲t̲
122+
.t̵o̵N̵u̵m̵t̲o̲N̲a̲t̲
123123
-/
124124
#guard_msgs in
125125
#eval Foo.Bar.three.toNum
@@ -130,7 +130,7 @@ error: Invalid field `toStr`: The environment does not contain `Foo.Bar.toStr`,
130130
of type `Foo.Bar`
131131
132132
Hint: Perhaps you meant `Foo.Bar.toString` in place of `Foo.Bar.toStr`:
133-
Foo.Bar.two.t̵o̵S̵t̵r̵t̲o̲S̲t̲r̲i̲n̲g̲
133+
.t̵o̵S̵t̵r̵t̲o̲S̲t̲r̲i̲n̲g̲
134134
-/
135135
#guard_msgs in
136136
#eval Foo.Bar.two.toStr
@@ -274,7 +274,35 @@ error: Invalid field `not`: The environment does not contain `MyBool.not`, so it
274274
of type `MyBool`
275275
276276
Hint: Perhaps you meant `MyBool.swap` in place of `MyBool.not`:
277-
MyBool.tt.n̵o̵t̵s̲w̲a̲p̲
277+
.n̵o̵t̵s̲w̲a̲p̲
278278
-/
279279
#guard_msgs in
280280
example := MyBool.tt.not
281+
282+
/--
283+
error: Invalid field `not`: The environment does not contain `MyBool.not`, so it is not possible to project the field `not` from an expression
284+
(fun x => if x < 3 then MyBool.tt else MyBool.ff) 4
285+
of type `MyBool`
286+
287+
Hint: Perhaps you meant `MyBool.swap` in place of `MyBool.not`:
288+
.n̵o̵t̵s̲w̲a̲p̲
289+
-/
290+
#guard_msgs in
291+
example := ((fun x => if x < 3 then MyBool.tt else .ff) 4).not
292+
293+
294+
@[suggest_for MyBool.not]
295+
def MyBool.justFalse : MyBool → MyBool
296+
| _ => ff
297+
298+
/--
299+
error: Invalid field `not`: The environment does not contain `MyBool.not`, so it is not possible to project the field `not` from an expression
300+
(fun x => if x < 3 then MyBool.tt else MyBool.ff) 4
301+
of type `MyBool`
302+
303+
Hint: Perhaps you meant one of these in place of `MyBool.not`:
304+
[apply] `MyBool.justFalse`
305+
[apply] `MyBool.swap`
306+
-/
307+
#guard_msgs in
308+
example := ((fun x => if x < 3 then MyBool.tt else .ff) 4).not

0 commit comments

Comments
 (0)