modular icon indicating copy to clipboard operation
modular copied to clipboard

[BUG] using alias in Set with one or more arguments fails

Open IbarraSamuel opened this issue 1 year ago • 0 comments

Bug description

When using Set collection in mojo, all works if is a variable. When it's constant using alias, Set only works if the constructor has no arguments. When you pass 1 or more arguments, the compiler says:

  • "no viable expansions found" for "fn main():"
  • "failed to evaluate 'apply'" for "alias const_set = SetInt

No errors are displayed on the Linter (When running on VSCode).

Steps to reproduce

from collections import Set


fn main():
    alias const_empty_set = Set[Int]()  # ok
    alias const_set = Set[Int](1)  # fails

System information

- Mojo Playground
- mojo 24.2.0 (c2427bc5)
- modular 0.6.0 (04c05243)

IbarraSamuel avatar Mar 30 '24 15:03 IbarraSamuel