BUG描述
repro_format.mojo
fn tryit[dims: Int]() -> None:
@parameter
constrained[dims % 2 == 0, "dims must be power of two"]()
pass
fn main():
tryit[64]()
tryit[3]()
重现步骤
$ mojo format repro_format.mojo
error: cannot format repro_format.mojo: Cannot parse: 3:4: constrained[dims % 2 == 0, "dims must be power of two"]()
如果注释掉无效的参数调用,则会发生相同的错误:
# tryit[3]()
系统信息
mojo 0.5.0 (6e50a738)
modular 0.2.2 (95d42445)
Darwin macbookair.local 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:28:31 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T8112 arm64