Use input type variants when creating discriminated unions

Cleanup
This commit is contained in:
Vivek Lakshmanan 2021-05-21 00:33:50 -07:00
parent 67bcd73a15
commit cd51032fc5

View file

@ -92,7 +92,7 @@ func rewriteConversions(x model.Expression, to model.Type) (model.Expression, bo
x.Key, _ = rewriteConversions(x.Key, x.KeyType())
case *model.ObjectConsExpression:
if v := resolveDiscriminatedUnions(x, to); v != nil {
to = v
to = model.InputType(v)
typecheck = true
}
for i := range x.Items {