-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
171 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/-! | ||
# Make sure there is type information on `_` for inst parameters in explicit mode | ||
-/ | ||
|
||
example : Nat := @ite _ True _ 1 2 | ||
--^ textDocument/hover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{"textDocument": {"uri": "file:///explicitAppInstHole.lean"}, | ||
"position": {"line": 4, "character": 29}} | ||
{"range": | ||
{"start": {"line": 4, "character": 29}, "end": {"line": 4, "character": 30}}, | ||
"contents": | ||
{"value": | ||
"```lean\ninstDecidableTrue : Decidable True\n```\n***\nA placeholder term, to be synthesized by unification. \n***\n*import Init.Core*", | ||
"kind": "markdown"}} |
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
tests/lean/missingExplicitWithForwardNamedDep.lean.expected.out
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/-! | ||
# Tests for app elaborator in explicit mode | ||
-/ | ||
|
||
namespace Test1 | ||
|
||
/-! | ||
Named arguments in explicit mode should not cause arguments they depend on to become implicit, | ||
except when doing error recovery. | ||
-/ | ||
|
||
theorem foo {p : Prop} [Decidable p] (h : ite p x y = x) : p := sorry | ||
|
||
variable {p : Prop} [Decidable p] {α : Type} (x y : α) (h : ite p x y = x) | ||
|
||
|
||
/-- | ||
error: insufficient number of arguments, missing 5 explicit argument(s) that are dependencies of a named argument. | ||
Such arguments can be filled in with '_', or '(_)' if it is a non-canonical instance argument. | ||
These are the inferred missing arguments: | ||
α | ||
x | ||
y | ||
p | ||
inst✝ | ||
-/ | ||
#guard_msgs in example : p := @foo (h := h) | ||
|
||
example : p := @foo (h := h) _ _ _ _ _ | ||
|
||
/-- | ||
error: function expected at | ||
foo h | ||
term has type | ||
p | ||
-/ | ||
#guard_msgs in | ||
example : p := @foo (h := h) _ _ _ _ _ _ | ||
|
||
end Test1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
class Foo (α : Type) (β : Type) where | ||
val : Nat | ||
a : α | ||
b : β | ||
|
||
/-- info: Foo.val (α β : Type) [self : Foo α β] : Nat -/ | ||
#guard_msgs in #check Foo.val | ||
|
||
def valOf [s : Foo α β] : Nat := | ||
s.val | ||
|
||
/-- info: 10 -/ | ||
#guard_msgs in #eval valOf (s := { val := 10, a := true, b := false : Foo Bool Bool }) | ||
|
||
def valOf2 (α β : Type) [s : Foo α β] : Nat := | ||
s.val | ||
|
||
/-- | ||
error: insufficient number of arguments, missing 2 explicit argument(s) that are dependencies of a named argument. | ||
Such arguments can be filled in with '_', or '(_)' if it is a non-canonical instance argument. These are the inferred missing arguments: | ||
Bool | ||
Bool | ||
--- | ||
info: valOf2 Bool Bool : Nat | ||
-/ | ||
#guard_msgs in #check valOf2 (s := { val := 10, a := true, b := false : Foo Bool Bool }) | ||
|
||
def f (x y z : Nat) := x + y + z | ||
|
||
/-- info: fun x y => f x y 10 : Nat → Nat → Nat -/ | ||
#guard_msgs in | ||
#check f (z := 10) | ||
|
||
def g {α : Type} (a b : α) := b | ||
/-- info: fun a => g a 10 : Nat → Nat -/ | ||
#guard_msgs in #check g (b := 10) | ||
|
||
def h (α : Type) (a b : α) := b | ||
/-- | ||
error: insufficient number of arguments, missing 1 explicit argument(s) that are dependencies of a named argument. | ||
Such arguments can be filled in with '_', or '(_)' if it is a non-canonical instance argument. These are the inferred missing arguments: | ||
Bool | ||
--- | ||
info: fun a => h Bool a true : Bool → Bool | ||
-/ | ||
#guard_msgs in #check h (b := true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters