Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8513] Confusing error messages for interactions between same-name types from different modules #51033

Closed
huonw mannequin opened this issue Aug 10, 2018 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers

Comments

@huonw
Copy link
Mannequin

huonw mannequin commented Aug 10, 2018

Previous ID SR-8513
Radar rdar://problem/33329838
Original Reporter @huonw
Type Bug
Status Resolved
Resolution Done
Environment

Master on 2018-08-09

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee owenvoorhees (JIRA)
Priority Medium

md5: a82cf2befaf2c7e2b4a1d862b2ae2686

is duplicated by:

  • SR-11024 Type mismatch diagnostic is confusing for overloaded type names

Issue Description:

// samename_mod.swift
public struct X {}
// samename.swift
import samename_mod

struct X {}
let _: samename_mod.X = X()

Compiling with

swiftc samename_mod.swift -emit-module
swiftc samename.swift -I .

Gives

samename.swift:4:25: error: cannot convert value of type 'X' to specified type 'X'
let _: samename_mod.X = X()
                        ^~~

The problem is that samename_mod.X (from the first file/module) is different to the samename.X (second file/module), but the error message doesn't disambiguate.

(This originally came up with Swift.Error versus a custom Error type.)

@swift-ci
Copy link
Collaborator

Comment by Owen Voorhees (JIRA)

Resolved in [[Diagnostics]: Qualify Type arguments to diagnostics if there are name collisions|#25510] / [[5.1] Various improvements for 'some' type diagnostics|#25883]

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant