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-8470] Code completion: Assertion failed: (hasInterfaceType() && "No interface type was set") #50991

Closed
nathawes opened this issue Aug 6, 2018 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@nathawes
Copy link
Collaborator

nathawes commented Aug 6, 2018

Previous ID SR-8470
Radar rdar://problem/43057054
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, CompilerCrash
Assignee @rintaro
Priority Medium

md5: d2b70dc0da8a178f71cec32fb0b4b047

Issue Description:

func curry<T1, T2, R>(_ f: @escaping (T1, T2) -> R) -> (T1) -> (T2) -> R {
  return { t1 in { t2 in f(#^COMPLETE^#t1, t2) } }
}

{code:title=$ swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test.swift}
found code completion token COMPLETE at offset 102
found code completion token COMPLETE at offset 102
Assertion failed: (hasInterfaceType() && "No interface type was set"), function getInterfaceType, file /Users/nathanhawes/workspace/open-swift-source-compat-suite-master/swift/lib/AST/Decl.cpp, line 2137.
0 swift-ide-test 0x0000000105d738b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift-ide-test 0x0000000105d72826 llvm::sys::RunSignalHandlers() + 198
2 swift-ide-test 0x0000000105d73ed2 SignalHandler(int) + 258
3 libsystem_platform.dylib 0x00007fff7dd65f5a _sigtramp + 26
4 libsystem_platform.dylib 0x00007fc261097910 _sigtramp + 3811776976
5 libsystem_c.dylib 0x00007fff7db0f1ae abort + 127
6 libsystem_c.dylib 0x00007fff7dad71ac basename_r + 0
7 swift-ide-test 0x0000000102de13a2 swift::ValueDecl::getInterfaceType() const + 50
8 swift-ide-test 0x00000001027fe840 calculateTypeRelationForDecl(swift::Decl const*, swift::Type, bool, bool) + 496
9 swift-ide-test 0x00000001027fc572 swift::ide::CodeCompletionResultBuilder::takeResult() + 1298
10 swift-ide-test 0x0000000102814dbd (anonymous namespace)::CompletionLookup::addVarDeclRef(swift::VarDecl const*, swift::DeclVisibilityKind) + 1341
11 swift-ide-test 0x0000000102811c99 (anonymous namespace)::CompletionLookup::FilteredDeclConsumer::foundDecl(swift::ValueDecl*, swift::DeclVisibilityKind) + 73
12 swift-ide-test 0x0000000102e61ce1 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 433
13 swift-ide-test 0x00000001028074e1 (anonymous namespace)::CompletionLookup::getValueCompletionsInDeclContext(swift::SourceLoc, std::__1::function<bool (swift::ValueDecl*, swift::DeclVisibilityKind)>, bool, bool, bool) + 305
14 swift-ide-test 0x0000000102802478 (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 10200
15 swift-ide-test 0x0000000102cfee50 (anonymous namespace)::ParseDelayedFunctionBodies::walkToDeclPre(swift::Decl*) + 304
16 swift-ide-test 0x0000000102db9abb (anonymous namespace)::Traversal::doIt(swift::Decl*) + 171
17 swift-ide-test 0x0000000102db99fb swift::Decl::walk(swift::ASTWalker&) + 27
18 swift-ide-test 0x0000000102e7229a swift::SourceFile::walk(swift::ASTWalker&) + 170
19 swift-ide-test 0x0000000102e70baf swift::ModuleDecl::walk(swift::ASTWalker&) + 95
20 swift-ide-test 0x0000000102cf7f57 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 215
21 swift-ide-test 0x00000001027e7fd9 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 1081
22 swift-ide-test 0x00000001027e7269 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 505
23 swift-ide-test 0x000000010276c212 main + 27554
24 libdyld.dylib 0x00007fff7da63015 start + 1
25 libdyld.dylib 0x0000000000000005 start + 2186924017
Stack dump:
0. Program arguments: ../open-swift-source-compat-suite-master/build/compat_macos/swift-macosx-x86_64/bin/swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test2.swift

  1. While walking into decl 'curry(_🙂' at /tmp/test2.swift:1:1
    Abort trap: 6
@nathawes
Copy link
Collaborator Author

nathawes commented Aug 6, 2018

@swift-ci create

@rintaro
Copy link
Mannequin

rintaro mannequin commented Aug 10, 2018

#18591

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels Dec 12, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
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. code completion Area → source tooling: code completion compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

2 participants