mojo
mojo copied to clipboard
[BUG] Type using associated alias of mutually recursive other type isn't recognised as `CollectionElement`
Bug description
As title.
Steps to reproduce
from collections import Optional
@value
struct A(CollectionElement):
var val: B.T
struct B:
alias T = Int
var val: Optional[A] # error: 'Optional' parameter #0 has 'CollectionElement' type, but value has type 'A'
Replacing B.T
with Int solves the problem.
System information
Mojo 24.1 on Docker, Intel Mac