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 complexity + LuauTarjanChildLimit causes *error-type* for resolved requires #112

Open
ghost opened this issue Aug 22, 2022 · 5 comments
Labels
blocked/external Blocked on external factor bug Something isn't working

Comments

@ghost
Copy link

ghost commented Aug 22, 2022

local module = require(script:FindFirstChild("module"))
local module = {}

function module.execute(player: Player) end -- Won't occur with `player: Instance`.

return module

While I can jump to the module from the require line, module gets typed to *error-type*. This does not occur with "Fflags Enable By Default" off. I don't think this occurred five days ago.

I haven't yet been able to replicate this in a new project.

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Sep 3, 2022
@JohnnyMorganz
Copy link
Owner

Strange..., I can reproduce this in my project, but not in a new project as well.

@JohnnyMorganz
Copy link
Owner

Few things I can uncover from this:

  • Setting FFlag LuauTarjanChildLimit to 0 fixes this.
  • Because we are using the autocomplete typechecker, we are subject to the dynamic limits set on the autocomplete (so that it resolves in a reasonable amount of time). Alternatively, setting LuauAutocompleteDynamicLimits to False can fix this (probably also why "fflags enable by default" causes this)
  • If you don't want to use the autocomplete typechecker to provide hover information, you can disable luau-lsp.hover.strictDatamodelTypes. The side effect of disabling this means the limits are no longer used, so this should resolve correctly
  • The error depends on the complexity of the types and complexity of the project the module is present in

@JohnnyMorganz JohnnyMorganz changed the title Fflags Enable By Default setting causing warnings with Player Type complexity + LuauTarjanChildLimit causes *error-type* for resolved requires Sep 4, 2022
@JohnnyMorganz JohnnyMorganz added the blocked/external Blocked on external factor label Sep 4, 2022
@JohnnyMorganz
Copy link
Owner

The issue also occurs for external packages, e.g. https://wally.run/package/vorlias/net

@JohnnyMorganz
Copy link
Owner

From discord: It seems the issue is tied to the size of the sourcemap.
It is most likely our "makeLazyInstanceType" is expensive

@JohnnyMorganz
Copy link
Owner

I've manually enforced a lower bound of 15,000 on LuauTarjanChildLimit to help alleviate some issues.

@JohnnyMorganz JohnnyMorganz pinned this issue Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/external Blocked on external factor bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant