chore(kernel/error_msgs): change type mismatch error messages, closes #33
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
9e6c5695be
commit
2486c483cf
7 changed files with 30 additions and 30 deletions
|
@ -55,10 +55,10 @@ format pp_app_type_mismatch(formatter const & fmt, expr const & app, expr const
|
|||
r += pp_indent_expr(fmt, app);
|
||||
r += compose(line(), format("term"));
|
||||
r += pp_indent_expr(fmt, arg);
|
||||
r += compose(line(), format("is expected of type"));
|
||||
r += expected_fmt;
|
||||
r += compose(line(), format("but is given type"));
|
||||
r += compose(line(), format("has type"));
|
||||
r += given_fmt;
|
||||
r += compose(line(), format("but is expected to have type"));
|
||||
r += expected_fmt;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -67,10 +67,10 @@ format pp_def_type_mismatch(formatter const & fmt, name const & n, expr const &
|
|||
std::tie(expected_fmt, given_fmt) = pp_until_different(fmt, expected_type, given_type);
|
||||
format r("type mismatch at definition '");
|
||||
r += format(n);
|
||||
r += format("', it is expected of type");
|
||||
r += expected_fmt;
|
||||
r += compose(line(), format("but is given type"));
|
||||
r += format("', has type");
|
||||
r += given_fmt;
|
||||
r += compose(line(), format("but is expected to have type"));
|
||||
r += expected_fmt;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
@ -496,10 +496,10 @@ struct unifier_fn {
|
|||
}
|
||||
format expected_fmt, given_fmt;
|
||||
std::tie(expected_fmt, given_fmt) = pp_until_different(fmt, m_type, v_type);
|
||||
r += compose(line(), format("placeholder is expected of type"));
|
||||
r += expected_fmt;
|
||||
r += compose(line(), format("but is given type"));
|
||||
r += compose(line(), format("placeholder has type"));
|
||||
r += given_fmt;
|
||||
r += compose(line(), format("but is expected to have type"));
|
||||
r += expected_fmt;
|
||||
r += compose(line(), format("the assignment was attempted when trying to solve"));
|
||||
r += nest(2*get_pp_indent(fmt.get_options()), compose(line(), j.pp(fmt, nullptr, subst)));
|
||||
return r;
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
bug1.lean:9:7: error: type mismatch at definition 'and_intro', it is expected of type
|
||||
bug1.lean:9:7: error: type mismatch at definition 'and_intro', has type
|
||||
∀ (p q : bool),
|
||||
p → q → (∀ (c : bool), (p → q → c) → c)
|
||||
but is expected to have type
|
||||
∀ (p q : bool),
|
||||
p → q → a
|
||||
but is given type
|
||||
bug1.lean:13:7: error: type mismatch at definition 'and_intro', has type
|
||||
∀ (p q : bool),
|
||||
p → q → (∀ (c : bool), (p → q → c) → c)
|
||||
bug1.lean:13:7: error: type mismatch at definition 'and_intro', it is expected of type
|
||||
but is expected to have type
|
||||
∀ (p q : bool),
|
||||
p → q → and p p
|
||||
but is given type
|
||||
bug1.lean:17:7: error: type mismatch at definition 'and_intro', has type
|
||||
∀ (p q : bool),
|
||||
p → q → (∀ (c : bool), (p → q → c) → c)
|
||||
bug1.lean:17:7: error: type mismatch at definition 'and_intro', it is expected of type
|
||||
but is expected to have type
|
||||
∀ (p q : bool),
|
||||
p → q → and q p
|
||||
but is given type
|
||||
∀ (p q : bool),
|
||||
p → q → (∀ (c : bool), (p → q → c) → c)
|
||||
and_intro : ∀ (p q : bool), p → q → and p q
|
||||
|
|
|
@ -3,7 +3,7 @@ crash.lean:8:12: error: type mismatch at application
|
|||
?M_1
|
||||
term
|
||||
H
|
||||
is expected of type
|
||||
not P
|
||||
but is given type
|
||||
has type
|
||||
P
|
||||
but is expected to have type
|
||||
not P
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
empty.lean:5:25: error: type error in placeholder assigned to
|
||||
inhabited_Prop
|
||||
placeholder is expected of type
|
||||
inhabited ?M_1
|
||||
but is given type
|
||||
placeholder has type
|
||||
inhabited Prop
|
||||
but is expected to have type
|
||||
inhabited ?M_1
|
||||
the assignment was attempted when trying to solve
|
||||
failed to synthesize placeholder
|
||||
⊢ inhabited Empty
|
||||
|
|
|
@ -30,9 +30,9 @@ let1.lean:16:10: error: type mismatch at application
|
|||
term
|
||||
λ (p q : Prop) (H1 : p) (H2 : q) (c : Prop) (H : p → q → c),
|
||||
H H1 H2
|
||||
is expected of type
|
||||
∀ (p q : Prop),
|
||||
p → q → (λ (p q : Prop), ∀ (c : Prop), (p → q → c) → c) q p
|
||||
but is given type
|
||||
has type
|
||||
∀ (p q : Prop),
|
||||
p → q → (∀ (c : Prop), (p → q → c) → c)
|
||||
but is expected to have type
|
||||
∀ (p q : Prop),
|
||||
p → q → (λ (p q : Prop), ∀ (c : Prop), (p → q → c) → c) q p
|
||||
|
|
|
@ -3,10 +3,10 @@ t10.lean:14:6: error: type mismatch at application
|
|||
ite (and p q) q
|
||||
term
|
||||
q
|
||||
is expected of type
|
||||
N
|
||||
but is given type
|
||||
has type
|
||||
B
|
||||
but is expected to have type
|
||||
N
|
||||
cons x (cons y (cons z (cons x (cons y (cons y nil))))) : list
|
||||
cons x nil : list
|
||||
nil : list
|
||||
|
|
Loading…
Reference in a new issue