When attempting to use a module-prefixed type name in a foreach loop the parser sees the : and assumes it's a untyped variable e.g. foreach (foo : {}) {
1: module test;
2:
3: fn void main() {
4: foreach (foo::Foo f : {}) {
^^
(/home/allie/Documents/code-probe/lol.c3l/test.c3:4:17) Error: Expected ':'.
Here's a minimal reproduction
module test;
fn void main() {
foreach (foo::Foo f : {}) {
}
}
module foo;
typedef Foo = int;
When attempting to use a module-prefixed type name in a
foreachloop the parser sees the:and assumes it's a untyped variable e.g.foreach (foo : {}) {Here's a minimal reproduction