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-8659] let x = #keyPath(x) // Assertion failed: (hasInterfaceType() && "No interface type was set") #51174

Closed
mayoff opened this issue Aug 29, 2018 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software type checker Area → compiler: Semantic analysis

Comments

@mayoff
Copy link

mayoff commented Aug 29, 2018

Previous ID SR-8659
Radar rdar://problem/43822883
Original Reporter @mayoff
Type Bug
Status Closed
Resolution Done
Environment

macOS 10.13.6 (17G65)

swift-DEVELOPMENT-SNAPSHOT-2018-08-26-a.xctoolchain

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, TypeChecker
Assignee @mayoff
Priority Medium

md5: 8af6afd00433c76b546c694c24ecb920

Issue Description:

Type this into the Swift REPL:

let x = #keyPath(x)

Result:

Assertion failed: (hasInterfaceType() && "No interface type was set"), function getInterfaceType, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/AST/Decl.cpp, line 2193.
Abort trap: 6
@belkadan
Copy link
Contributor

@swift-ci create

@xedin
Copy link
Member

xedin commented May 7, 2020

I have tried the snippet from description and it looks like compiler correctly identifies this as a circular reference. @mayoff Could you please verify with latest master snapshot?

error: circular reference
let x = #keyPath(x)
^
note: through reference here
let x = #keyPath(x)
    ^
note: through reference here
let x = #keyPath(x)
    ^
error: argument of '#keyPath' refers to non-'@objc' property 'x'
let x = #keyPath(x)
                 ^

@mayoff
Copy link
Author

mayoff commented May 7, 2020

Xcode 11.3.1's swift crashed with the input. Xcode 11.4.1's swift correctly issues an error.

@xedin
Copy link
Member

xedin commented May 7, 2020

@mayoff Thank you!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 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 crash Bug: A crash, i.e., an abnormal termination of software type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants