Use a class to check validity of withDict
This moves handling of the magic withDict
function from the desugarer to the typechecker. Details in Note [withDict]
.
I've extracted a part of T16646Fail
to a separate file T16646Fail2
, because the new error in reify
hides the errors from f
and g
.
WithDict
now works with casts, this fixes #21328 (closed).
Part of #19915