swiftlang/swift

[SR-3254] Unhelpful diagnostics for compound name reference.

Open

#45.842 geöffnet am 22. Nov. 2016

Auf GitHub ansehen
 (9 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Swift (10.719 Forks)batch import
bugcompilerdiagnostics qualityfunction referencesgood first issueswift 6.0type checker

Repository-Metriken

Stars
 (69.989 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T 17h) (510 gemergte PRs in 30 T)

Beschreibung

Previous ID SR-3254
Radar None
Original Reporter @rintaro
Type Bug

Swift version 3.0.1 (swift-3.0.1-RELEASE)
Target: x86_64-unknown-linux-gnu

Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee None
Priority Medium

md5: fcfded4004226fb4776f82d7b6864fca

relates to:

  • SR-4867 func foo() {}; foo(_:) // Use of unresolved identifier 'foo'

Issue Description:

func foo(x: Int) {}
let f = foo(_:)

emits:

test.swift:2:9: error: use of unresolved identifier 'foo'
let f = foo(_:)
        ^~~~~~~
test.swift:1:6: note: did you mean 'foo'?
func foo(x: Int) {}
     ^

Because foo does exist. It should be something like:

test.swift:2:9: error: use of unresolved name 'foo(_:)'
let f = foo(_:)
        ^~~~~~~
test.swift:1:6: note: did you mean 'foo(x:)'?
func foo(x: Int) {}
     ^

Contributor Guide