Skip to content

Function return type can't be determined when using "return somefunc(...)" statement. #563

Closed
@MikuAuahDark

Description

@MikuAuahDark

Describe the bug
When a function returns value from another function call, the caller function return type reverts to "any".

To Reproduce
This simple code tells everything.

local function failedReturnTypeDeduction()
	return string.sub("Hello", 2)
end

Then hover your cursor to failedReturnTypeDeduction.

Expected behavior
failedReturnTypeDeduction return type should be string since string.sub returns string.

Screenshots
gambar

Environment (please complete the following information):

  • OS: Windows
  • Is WSL remote? No
  • Client: VSCode

Provide logs
file_d%3A_Data_Development_love-11.3-win64_nlay.log

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