Skip to content

Return type from string functions doesn't get infered correctly. #396

@NightrainsRbx

Description

@NightrainsRbx

When calling a function from the string library or a method from a string which returns string, the variable seems to infer the type, but the type infered doens't work.

For example:

test

I also tested the io library and file type and they do work, custom classes works too.

Adding ---@type string to variable seems to work better but after calling a function on the infered types it stops working:

test2

I also tried adding ---@type string* and it works just like the string literal and the library.

Environment:

OS: Windows
Client: VSCode
I'm using the latest version of lua language server (1.15.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions