Issues with trait resolution when local traits shadow glob imported ones #5700
Labels
bug
Something isn't working
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler
General compiler. Should eventually become more specific as the issue is triaged
We have several issues in trait resolution when there are local traits shadowing glob imported ones (from the prelude or own libs, both). I am listing all the issues here using the
Shift
trait from the prelude (core::ops::Shift
) and own libs as example.Local trait with same trait items as glob imported
If the local trait has exactly the same items like the glob imported trait, the error will be emitted, that the trait is already implemented where the implementation is one coming from the
core::ops
in this case.Local trait with different trait items as glob imported
Interestingly, if the local trait has different trait items as the glob imported one, it looks like the local one get's picked in the resolution, because the errors emitted are pointing to missing implementation of items, and implementing non-existing items.
This will emit the following errors, which means that in this case the local
Shift
was resolved (as it should be):Same issues with non-prelude items
E.g., if we have a lib.sw:
and a main.sw:
The text was updated successfully, but these errors were encountered: