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

Inconsistent Instance:FindFirstChild types with absolute and relative paths #647

Closed
Ketasaja opened this issue Jun 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Ketasaja
Copy link
Contributor

Ketasaja commented Jun 9, 2024

Since there can only be one service, it's surprising to me that folder and folderAgain don't have the same type. luau-lsp.hover.strictDatamodelTypes and luau-lsp.diagnostics.strictDatamodelTypes are true.

--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- `folder: Folder`
local folder = script.Parent.Parent:FindFirstChild("ReplicatedStorage"):FindFirstChild("Shared"):FindFirstChild("folder")
-- `folderAgain: Instance?`, `TypeError`
local folderAgain = ReplicatedStorage:FindFirstChild("Shared"):FindFirstChild("folder")
{
  "name": "findfirstchild",
  "tree": {
    "$className": "DataModel",

    "ReplicatedStorage": {
      "Shared": {
        "$path": "src/shared"
      }
    },

    "ServerScriptService": {
      "Server": {
        "$path": "src/server"
      }
    }
  }
}

luau-lsp-inconsistent-findfirstchild

@JohnnyMorganz
Copy link
Owner

I think this should get fixed by f657718. I will add a test case for this

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants