Open rd4com opened 4 months ago
from sys import param_env
alias DefaultError =
param_env.env_get_string['error_message']()
def main():
alias MakeSureThat = constrained
MakeSureThat[
"error" in DefaultError,
"if not, unacceptable error message:"+DefaultError
]()
raise DefaultError
mojo run -D error_message="this is the default error message, it is kind of long in order to test the constrained" test_.mojo
Same error as in description
But it works well (meaning no error) with smaller inputs:
mojo build -D error_message="the error message is small" test_.mojo
Tried to find a bug starting from there, but could not:
fn __contains__(self, substr: StringLiteral) -> Bool:
return substr in StringRef(self)
https://github.com/modularml/mojo/blob/nightly/stdlib/src/builtin/string_literal.mojo
Bug description
edit: see first comment of the github issue
Hello,
i was working on an hopefully really helpful tutorial :+1: and after adding a constrained:
Example:
Error:
mojo run -D error_message="this is the default error message, it is kind of long in order to test the constrained" test_.mojo
Steps to reproduce
Nothing special, it is in the bug description
System information