You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swift-ci opened this issue
Mar 15, 2018
· 7 comments
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfparserArea → compiler: The legacy C++ parser
SourceKit USRs are not unique within a file for variables, even in well-formed programs:
forxin [1, 2, 3] {
print(x)
}
forxin [4, 5, 6] { // This `x` has the same USR as that on line 1 and 2print(x)
}
iftrue {
letx = 42// This `x` has the same USR as that on line 1 and 2print(x)
}
ifletx = Int("42") { // This `x` has the same USR as that on line 1 and 2print(x)
}
The text was updated successfully, but these errors were encountered:
Sounds like we are not correctly handling the local discriminators for top-level code. It's probably getting reset between each TopLevelCodeDecl chunk, which is understandable but wrong.
@belkadan This is not specific to top-level code. If you put that code in a function you get the same problem. It affects all local variables and top-level code variables in the same decl context with the same name+type.
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfparserArea → compiler: The legacy C++ parser
Environment
MacOS 10.13.2
Swift 4.0.3
Additional Detail from JIRA
md5: 13029f03cc6b31b8ec9542c47068e618
Issue Description:
SourceKit USRs are not unique within a file for variables, even in well-formed programs:
The text was updated successfully, but these errors were encountered: