You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes the smart motive doesn't make all the substitutions it should and that results in confusing error messages.
To Reproduce
Copy and paste the following snippet:
TestType(b: Bool): Type
case b {
true: Nat
false: String
}
ComplexType(b: Bool, t: TestType(b)): Type
case b with t {
true: Nat
false: String
}!
Test(b: Bool, t: TestType(b)): ComplexType(b, t)
case b {
true: ?a
false: ?b
}!
Typechecking it results in a type error
Type mismatch.
- Expected: TestType(b)
- Detected: TestType(b)
Expected behavior
I expected those goals to appear with no type errors:
Goal ?a:
With type: ComplexType(Bool.true,t)
With context:
- b: Bool
- t: TestType(b)
- t: TestType(Bool.true)
Goal ?b:
With type: ComplexType(Bool.false,t)
With context:
- b: Bool
- t: TestType(b)
- t: TestType(Bool.false)
indeed that's what happens if you manually expand the lambda encoding:
Describe the bug
Sometimes the smart motive doesn't make all the substitutions it should and that results in confusing error messages.
To Reproduce
Copy and paste the following snippet:
Typechecking it results in a type error
Expected behavior
I expected those goals to appear with no type errors:
indeed that's what happens if you manually expand the lambda encoding:
my guess is that the smart motive is just replacing the ocurrences of
mb
and is forgettingmt
. Like thisand that explains the confusing error message.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: