8000 String literals aren't refined to singleton types in function overloads · Issue #1589 · luau-lang/luau · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
String literals aren't refined to singleton types in function overloads #1589
Closed
@vvatheus

Description

@vvatheus
--!strict
type IsFoo = (("foo") -> (true)) & (("bar") -> (false))

local isFoo: IsFoo = nil :: any

isFoo("foo") -- TypeError: None of the overloads for function that accept 1 arguments are compatible.

Autocomplete also doesn't work, presumably because the first argument isn't being refined as "foo" | "bar". But I'm not sure if this is an LSP issue or not.

This used to work in the old solver, but doesn't in the new solver.

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

      0