Skip to content

Types are not disambiguated #1641

Open
Open
@skrtks

Description

@skrtks

Swift version

swiftlang-6.0.0.6.8

Platform

macOS 14.6.1

Editor

VSCode

Does the issue reproduce with Swift 6?

Yes

Description

In the example below, the type of a is main.Int and the type of b is Swift.Int. LSP seems to ignore that the using the unqualified Int is ambiguous in this context.

class Int {}
let a = Int()
let b = 1 + 1

Steps to Reproduce

In VSCode, type hints provided by SK-LSP show the same type for both variables. When double clicking the type hint, the inserted type is ambiguous. A similar issue appears when invoking the extract expression refactoring. When we try to extract 1 + 1, the generated code looks like let extractedExpr: Int = 1 + 1.

Logging

No response

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