Raise returns a string?
I'm running this code:
It seems like if I
raise
an error on a function that returns a String
then the error value becomes the return value...
Is that expected behavior?3 Replies
You should filed a bug report (https://github.com/modularml/mojo/issues). The behavious seems specific to raising in a fn that returns a StringRef. Other return types raise appropriately and the print statement is never reached.
GitHub
[BUG]: raises returns a StringRef · Issue #926 · modularml/mojo
Bug description When you have a function that returns a StringRef and it raises an error the function will return the value of that error. Is this expected behavior? Steps to reproduce fn test() ra...
Thanks very much for the report this is currently being worked on