You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cyan build
Error 2 type errors in src/test.lua
... src/test.lua 3:7
... 3 | local a
... | ^
... | variable 'a' has no type or initial value
...
... src/test.lua 4:7
... 4 | local b
... | ^
... | variable 'b' has no type or initial value
Info Type checked src/main.tl
It looks like cyan tries to typecheck a lua file as if it was a teal file (even though there is a corresponding .d.tl file!).
The text was updated successfully, but these errors were encountered:
Cyan doesn't currently handle this use case too well. An awkward solution would be to move the lua file into the build directory and use the dont_prune config.
@euclidianAce I think I'm hitting the same issue when trying to use Cyan with the teal branch of LuaRocks.
Right now I have two kinds of Lua files under src, and I want to ignore both:
generated .lua files from the .tl files (I'm still keeping them under src/ to keep the build scripts compatible). I managed to get Cyan to ignore this by adding exclude = { "**/*.lua" } in my tlconfig.lua file
vendored Lua modules such as src/luarocks/vendor/argparse.lua, for which I have a src/luarocks/vendor/argparse.d.tl file. Looks like Cyan is still checking the .lua file (and thus outputting lots of errors) because these are referenced by other files as dependencies.
See repro: cyan-lua-compilation-repro.zip
When I have a following file structure:
And
tlconfg.lua
set to:Then cyan build fails:
It looks like cyan tries to typecheck a lua file as if it was a teal file (even though there is a corresponding
.d.tl
file!).The text was updated successfully, but these errors were encountered: