Trait impls inside modules are broken
Code to reproduce
struct A {}
trait X {
fn foo(self) -> bool;
}
mod M {
impl X for A {
fn foo(self) -> bool {
true
}
}
}
Reported error
bug: Failed to find trait X in the item list
┌─ test.spade:7:5
│
7 │ ╭ impl X for A {
8 │ │ fn foo(self) -> bool {
9 │ │ true
10 │ │ }
11 │ │ }
│ ╰─────^
│
= note: This is an internal bug in the compiler.
We would appreciate if you opened an issue in the repository:
https://gitlab.com/spade-lang/spade/-/issues/new?issuable_template=Internal%20bug
Reported error (Windows, idk whats going on)
GMLQt4Wcs3wDtSkco5ZJaweWDAYGlFg0qXRakRJqrdz8pQzAuJ1AG4OJqRYKqZEkCQqpIBjBvNn92LJ5w5Nr3/ben1276coDM8d3JkB+5GfPN56+4fDR49eeOXbkxlcO7r3x1NgEpiabaKcpzrfaIMaSy7Ux6K2FlccIXOHtC4Fa6CPJi2qVveyKMSfZRRdZkRBi4dVFAUI5tFYIA786/NDW6MVztVFRFM7dVtqpuzZ2cq8U2nEKrTWKPIdUCvVaDYOz+rBoeO7Y/JXr71+/adN9azZvmelUzQTIP9/znR1P33D+lX0fmpxsLho9euz68xNT/RPnz2NsYgoXplqQWiPJCjDG0VuPMNmOMbu3Aak0Ak90gePItOm6latrRL4P5TQbjFEkWQ7OGFpJ6n6PIM0KMEbRSjJ4Tr3YTrLKDoHBNgR6aiHqtQizh4bHlo0senLW4hWPzh1esHPDFTO3xUyA/C96Dr/w3MjE2RPbkqyonz07tvbsuQsrL5w7t7Y9dnJkqh3j5LkJxElW0dZ7axGSvIDSqvIX5IxV6x/GGORKIvJ9TLZjO4jUGn21GnwhMBXHNt1yxpzQ1r0qCjz01CNEgY95i5ftnTVv3u6Vy5Y87vl+6y1vv/nBmaM5EyBvqufIvheG8jQZLM4e314oxc+08np2bvSG8Xban2ZFQAhBq9UaklIGhVQiz4pAOY9zqTSUVPAcLtQP/NTjPAlDfyL0/WY0b9GTzAvHBOcpADBG5fyhebv7+voOEwIsWzdTaM8EyCX+HDtyhC8aGZEv79/fv3zVpcOmnQmQmQCZeWae7/vQmR/BzDPzfP/n/xsA0h5mQhfTSAkAAAAASUVORK5CYII=Error: aborting due to previous error
Edited by Alex Pichler