fix: new type ascription elaborator

It was propating the incorrect type.
This commit is contained in:
Leonardo de Moura 2021-04-27 16:03:27 -07:00
parent 2e250e6f04
commit e8531ef4de

View file

@ -230,7 +230,7 @@ where
match ← expandCDot? e with
| some e => `(($e : $type))
| none => Macro.throwUnsupported
| `(($e)) => do return (← expandCDot? e).getD e
| `(($e)) => return (← expandCDot? e).getD e
| `(($e, $es,*)) => do
let pairs ← mkPairs (#[e] ++ es)
(← expandCDot? pairs).getD pairs
@ -240,7 +240,7 @@ where
match stx with
| `(($e : $type)) =>
let type ← withSynthesize (mayPostpone := true) <| elabType type
let e ← elabTerm e expectedType?
let e ← elabTerm e type
ensureHasType type e
| _ => throwUnsupportedSyntax