Diagnostic for use of plain protocol name in type position should suggest `some` or `any`
@yyoungbash is already working on this.
Since Oct 29, 2025.
Assessment
This issue has not been assessed yet.
Description
The following code is invalid:
protocol P {
associatedtype A
}
func generic(value: P) {}
The compiler currently produces the error message Use of protocol 'P' as a type must be written 'any P' with a fix-it to insert the any keyword.
However, a different (and often better!) fix here is to use the some keyword. The error message should be re-worded to prompt the programmer to consider any or some, and there should be two notes, each with a fix-it to insert any or some, respectively.
- Dominant language
- Swift
- Stars
- 70.4k
- Forks
- 10.8k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 461
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from swiftlang/swift
-
triage needed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
triage needed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Foundation Windows
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
triage needed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
triage needed
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ionic-team/capacitor#8616 ·