where
clause shadows information about higher impl
s
#38071
Labels
A-type-system
Area: Type system
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
It appears that the typechecker, on encountering a
where
clause, will assume theimpl
information given in thewhere
bound and stop looking forimpl
s, thus missing additional information that may be available about theimpl
outside the item.For example, this code doesn't typecheck:
giving the error:
but the same code without the
where
-bound, which should be entirely redundant since it provides only information already known to the type-checker, compiles.This makes putting emulated HKTs into traits difficult, as a type that depends on such a thing must have a
where
clause in the trait that, though redundant, must appear in theimpl
to avoid E0195.Edit: Current error:
The text was updated successfully, but these errors were encountered: