Closed jrfondren closed 10 months ago
Multiple returns was designed to be used only with runtime variables, not for compile-time stuff (like types). So you hit an unsupported feature, I added an error for this in https://github.com/edubart/nelua-lang/commit/a1b4a34e68e3b0cbb92ea5a45be165770798ac74
Bug description
I split off some regex code into its own module, which included a test. So that I could run the test without adding it to the module's namespace, I considered returning a second record containing the test.
Code example
Expected behavior
To work or to be forbidden:
Actual behavior
Workaround
I'd prefer tests in a separate file anyway, but a very similar usage is possible with:
Environment
arm64 linux Nelua 0.2.0-dev Build number: 1588 Git date: 2023-09-16 16:20:44 -0300 Git hash: 596fcca5c77932da8a07c249de59a9dff3099495 Semantic version: 0.2.0-dev.1588+596fcca5 Copyright (C) 2019-2022 Eduardo Bart (https://nelua.io/)