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-12473] ASTScopeImpl: resorting to startingScope hack #54913

Closed
brentleyjones opened this issue Mar 31, 2020 · 10 comments
Closed

[SR-12473] ASTScopeImpl: resorting to startingScope hack #54913

brentleyjones opened this issue Mar 31, 2020 · 10 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@brentleyjones
Copy link
Contributor

Previous ID SR-12473
Radar rdar://problem/61111969
Original Reporter @brentleyjones
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee davidungar (JIRA)
Priority Medium

md5: 437546ca6ffb8aae48d47691faf5d113

Issue Description:

Compiling our project with Swift 5.2 we get a couple "ASTScopeImpl: resorting to startingScope hack" outputs in our build log:

ASTScopeImpl: resorting to startingScope hack, file: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift
'Message' loc: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift:43:41
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void


ASTScopeImpl: resorting to startingScope hack, file: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift
'Message' loc: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift:44:39
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void


ASTScopeImpl: resorting to startingScope hack, file: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift
'Message' loc: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift:45:55
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void


ASTScopeImpl: resorting to startingScope hack, file: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift
'PresentAlert' loc: https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift:47:25
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="https://user-images.githubusercontent.com/2727770/164963722-4a63f46d-bd56-4749-8055-de279ea37aa2.gz.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void
@theblixguy
Copy link
Collaborator

cc davidungar (JIRA User)

@swift-ci
Copy link
Collaborator

Comment by David Ungar (JIRA)

I'm sorry to see that. If you can send me any source code that reproduces the issue, I'll fix it. Sometimes, these errors happen when a lookup is performed in the wrong scope. Other times, they happen because the compiler internally has the wrong source range.

@swift-ci
Copy link
Collaborator

Comment by David Ungar (JIRA)

[(Apple Sync System)](https://bugs.swift.org/secure/ViewProfile.jspa?name=sync) create

@brentleyjones
Copy link
Contributor Author

I'll try to get you some sources. Thanks!

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 1, 2020

Comment by David Ungar (JIRA)

Wonderful! Thank you.

@brentleyjones
Copy link
Contributor Author

SR-12473.swift

> swiftc SR-12473.swift

ASTScopeImpl: resorting to startingScope hack, file: /Users/z002wrr/Desktop/SR-12473.swift
'Message' loc: /Users/z002wrr/Desktop/SR-12473.swift:43:41
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="/Users/z002wrr/Desktop/SR-12473.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void


ASTScopeImpl: resorting to startingScope hack, file: /Users/z002wrr/Desktop/SR-12473.swift
'Message' loc: /Users/z002wrr/Desktop/SR-12473.swift:44:39
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="/Users/z002wrr/Desktop/SR-12473.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void


ASTScopeImpl: resorting to startingScope hack, file: /Users/z002wrr/Desktop/SR-12473.swift
'Message' loc: /Users/z002wrr/Desktop/SR-12473.swift:45:55
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="/Users/z002wrr/Desktop/SR-12473.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void


ASTScopeImpl: resorting to startingScope hack, file: /Users/z002wrr/Desktop/SR-12473.swift
'PresentAlert' loc: /Users/z002wrr/Desktop/SR-12473.swift:47:25
starting context:
 0x7fde3c808478 Module name=main
  0x7fde3c0c6208 FileUnit file="/Users/z002wrr/Desktop/SR-12473.swift"
    0x7fde3c0c9e18 ClassDecl name=Manager
      0x7fde3c0ca498 AbstractFunctionDecl name=present() : (Manager) -> () -> ()
        0x7fde3c0ca758 AbstractClosureExpr line=38 : <null>
          0x7fde3c0ca9c0 AbstractClosureExpr line=39 : () -> Void
            0x7fde3c0cad70 AbstractClosureExpr line=42 : (Error) -> Void

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 1, 2020

Comment by David Ungar (JIRA)

Fantastic! I'll be diving in. Thank you very much.

@brentleyjones
Copy link
Contributor Author

I just wanted to chime in that this is still an issue in 5.2.4.

@brentleyjones
Copy link
Contributor Author

Also Xcode 12 beta 2.

@slavapestov
Copy link
Member

This is fixed on master. I'll add a regression test.

@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
Projects
None yet
Development

No branches or pull requests

4 participants