Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type checking error when using include_dir on windows #580

Open
LaylBongers opened this issue Nov 11, 2022 · 1 comment
Open

Type checking error when using include_dir on windows #580

LaylBongers opened this issue Nov 11, 2022 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@LaylBongers
Copy link

The same type will be seen as mismatching, because of a different path, even though the path refers to the same file.

PS C:\Users\Layl\Desktop\mpgb> tl build
========================================
1 error:
src\main.tl:33:30: argument 1: cc.Redirect (defined in src\cc.d.tl:6) is not a cc.Redirect (defined in .\src/cc.d.tl:6)

tlconfig.lua

return {
    source_dir = "src",
    include_dir = { "src" },
    build_dir = "dist",
    global_env_def = "src/cc",
    gen_target = "5.1",
}
@hishamhm hishamhm added bug Something isn't working good first issue Good for newcomers labels Nov 11, 2022
@hishamhm
Copy link
Member

@LaylBongers Thanks for the report!

I think one solution for this would be to move the normalize function from the tl script into the tl.tl module, and then use it in the search_for function.

It shouldn't be hard, but I'd really prefer getting a PR from a Windows user implementing this instead of trying it blindly myself on Linux. Test files spec/source_dir_spec.lua and spec/global_env_def_spec.lua should also have some examples on how to write tests for exercising this problem and the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants