def bar<N>(field[N] x) -> bool:
return N == 100
def foo(field[200] x) -> bool:
return bar(x)
def main(private field[100] x) -> bool:
return foo(x)
You would think calling foo from main would be a type error (and that's probably the right fix here), but failing that, you would think that the call to bar(x) inside foo would be equivalent to bar::<200>(x), but actually x "remembers" its "real" type and bar::<100>() is inferred.
You would think calling
foofrommainwould be a type error (and that's probably the right fix here), but failing that, you would think that the call tobar(x)insidefoowould be equivalent tobar::<200>(x), but actuallyx"remembers" its "real" type andbar::<100>()is inferred.