-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itself
Description
Previous ID | SR-4811 |
Radar | None |
Original Reporter | @masters3d |
Type | Bug |
Environment
Swift version 3.1 (swiftlang-802.0.51 clang-802.0.41
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 91be8b3f253fd92bb0bf138ca675e353
relates to:
- SR-1687 Swift does not warn about shadowing
Issue Description:
I recently learned that swifts allow variable names to shadow type names.
This is very surprising. Is this an intended feature?
let Void = "what?"
struct S {}
let S = 10
I've never run into this personally because I use swiftLint to force lowercase naming for variables.
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itself