|
| 1 | +-- test every/all replacements in default imports |
| 2 | + |
| 3 | +/- |
| 4 | +Expected replacements for `Subarray.any` and `Subarray.all` do not work as suggestion annotations |
| 5 | +when using generalized field notation: Subarray is an abbreviation and so the underlying `Std.Slice` |
| 6 | +type, which does not have a corresponding `.any`/`.all` function. |
| 7 | +-/ |
| 8 | + |
| 9 | +/-- |
| 10 | +error: Invalid field `every`: The environment does not contain `Std.Slice.every`, so it is not possible to project the field `every` from an expression |
| 11 | + x |
| 12 | +of type |
| 13 | + Std.Slice (Std.Slice.Internal.SubarrayData Nat) |
| 14 | +-/ |
| 15 | +#guard_msgs in example (x : Subarray Nat) := x.every fun _ => true |
| 16 | +#guard_msgs in example (x : Subarray Nat) := x.all fun _ => true |
| 17 | + |
| 18 | +/-- |
| 19 | +error: Unknown constant `Subarray.every` |
| 20 | +
|
| 21 | +Hint: Perhaps you meant `Subarray.all` in place of `Subarray.every`: |
| 22 | + [apply] `Subarray.all` |
| 23 | +-/ |
| 24 | +#guard_msgs in example := (@Subarray.every Nat (fun _ => true) ·) |
| 25 | +#guard_msgs in example := (@Subarray.all Nat (fun _ => true) ·) |
| 26 | + |
| 27 | +/-- |
| 28 | +error: Unknown constant `Subarray.some` |
| 29 | +
|
| 30 | +Hint: Perhaps you meant `Subarray.any` in place of `Subarray.some`: |
| 31 | + [apply] `Subarray.any` |
| 32 | +-/ |
| 33 | +#guard_msgs in example := (@Subarray.some Nat (fun _ => true) ·) |
| 34 | +#guard_msgs in example := (@Subarray.any Nat (fun _ => true) ·) |
| 35 | + |
| 36 | +/-- |
| 37 | +error: Invalid field `every`: The environment does not contain `String.every`, so it is not possible to project the field `every` from an expression |
| 38 | + x |
| 39 | +of type `String` |
| 40 | +
|
| 41 | +Hint: Perhaps you meant `String.all` in place of `String.every`: |
| 42 | + .e̵v̵e̵r̵y̵a̲l̲l̲ |
| 43 | +-/ |
| 44 | +#guard_msgs in example (x : String) := x.every fun _ => true |
| 45 | +#guard_msgs in example (x : String) := x.all fun _ => true |
| 46 | +/-- |
| 47 | +error: Invalid field `some`: The environment does not contain `String.some`, so it is not possible to project the field `some` from an expression |
| 48 | + x |
| 49 | +of type `String` |
| 50 | +
|
| 51 | +Hint: Perhaps you meant `String.contains` in place of `String.some`: |
| 52 | + .s̵o̵m̵e̵c̲o̲n̲t̲a̲i̲n̲s̲ |
| 53 | +-/ |
| 54 | +#guard_msgs in example (x : String) := x.some fun _ => true |
| 55 | +#guard_msgs in example (x : String) := x.contains fun _ => true |
| 56 | + |
| 57 | + |
| 58 | +/-- |
| 59 | +error: Invalid field `every`: The environment does not contain `Array.every`, so it is not possible to project the field `every` from an expression |
| 60 | + x |
| 61 | +of type `Array Nat` |
| 62 | +
|
| 63 | +Hint: Perhaps you meant `Array.all` in place of `Array.every`: |
| 64 | + .e̵v̵e̵r̵y̵a̲l̲l̲ |
| 65 | +-/ |
| 66 | +#guard_msgs in example (x : Array Nat) := x.every fun _ => true |
| 67 | +#guard_msgs in example (x : Array Nat) := x.all fun _ => true |
| 68 | +/-- |
| 69 | +error: Invalid field `some`: The environment does not contain `Array.some`, so it is not possible to project the field `some` from an expression |
| 70 | + x |
| 71 | +of type `Array Nat` |
| 72 | +
|
| 73 | +Hint: Perhaps you meant `Array.any` in place of `Array.some`: |
| 74 | + .s̵o̵m̵e̵a̲n̲y̲ |
| 75 | +-/ |
| 76 | +#guard_msgs in example (x : Array Nat) := x.some fun _ => true |
| 77 | +#guard_msgs in example (x : Array Nat) := x.all fun _ => true |
| 78 | + |
| 79 | +/-- |
| 80 | +error: Invalid field `every`: The environment does not contain `List.every`, so it is not possible to project the field `every` from an expression |
| 81 | + x |
| 82 | +of type `List Nat` |
| 83 | +
|
| 84 | +Hint: Perhaps you meant `List.all` in place of `List.every`: |
| 85 | + .e̵v̵e̵r̵y̵a̲l̲l̲ |
| 86 | +-/ |
| 87 | +#guard_msgs in example (x : List Nat) := x.every fun _ => true |
| 88 | +#guard_msgs in example (x : List Nat) := x.all fun _ => true |
| 89 | +/-- |
| 90 | +error: Invalid field `some`: The environment does not contain `List.some`, so it is not possible to project the field `some` from an expression |
| 91 | + x |
| 92 | +of type `List Nat` |
| 93 | +
|
| 94 | +Hint: Perhaps you meant `List.any` in place of `List.some`: |
| 95 | + .s̵o̵m̵e̵a̲n̲y̲ |
| 96 | +-/ |
| 97 | +#guard_msgs in example (x : List Nat) := x.some fun _ => true |
| 98 | +#guard_msgs in example (x : List Nat) := x.all fun _ => true |
| 99 | + |
| 100 | +/-- |
| 101 | +@ +1:17...22 |
| 102 | +error: Invalid field `every`: The environment does not contain `List.every`, so it is not possible to project the field `every` from an expression |
| 103 | + [1, 2, 3] |
| 104 | +of type `List ?m.10` |
| 105 | +
|
| 106 | +Hint: Perhaps you meant `List.all` in place of `List.every`: |
| 107 | + .e̵v̵e̵r̵y̵a̲l̲l̲ |
| 108 | +-/ |
| 109 | +#guard_msgs (positions := true) in |
| 110 | +#check [1, 2, 3].every |
0 commit comments