LuaLS / LuaLS/lua-language-server
Nested property type lost when accessed from reference
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Lua
- Sterne
- 4.4k
- Forks
- 442
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour
local A = {}
---@class B
---@overload fun(): B
local B = {}
---@class C
---@overload fun(): C
local C = {}
A.property1 = B()
A.property1.property2 = C()
local refToB = A.property1
local refToC = refToB.property2
while the local refToB is correctly of type B, it no longer is aware of property2.

expected behavior would be that it is aware of the properties assigned to the instance.
Actual Behaviour
presence of property is lost in the "instance" of object B (not definition).
Reproduction steps
- Go to '...'
- Click '...'
- See error '...'
Additional Notes
No response
Log File
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit dem Lua-Beispiel zur Typprüfung im Issue und reproduzieren Sie die fehlenden Eigenschaftsinformationen anhand der Zuweisungen an A.property1, refToB und refToC. Verfolgen Sie das relevante Verhalten der Typprüfung, bis refToB property2 beibehält und refToC als C aufgelöst wird; im Issue wird keine Repository-Datei und kein Test genannt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- lua
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100