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-8397] Assertion hit in code completion on unresolved member #50923

Closed
nathawes opened this issue Jul 28, 2018 · 2 comments
Closed

[SR-8397] Assertion hit in code completion on unresolved member #50923

nathawes opened this issue Jul 28, 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

Previous ID SR-8397
Radar rdar://problem/42828673
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: 9171039a5886ba609b317beca0b0eae1

Issue Description:

public enum objc_AssociationPolicy {
    case OBJC_ASSOCIATION_RETAIN_NONATOMIC
}

public func objc_setAssociatedObject(_ value: Any?, _ policy: objc_AssociationPolicy) {}

struct Foo<Outer> {
  internal func setValue<Value>(_ value: Value?) {
    objc_setAssociatedObject(value, .#^COMPLETE^#OBJC_ASSOCIATION_RETAIN_NONATOMIC )
  }
}

{code:title=$ swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test.swift}
found code completion token COMPLETE at offset 281
found code completion token COMPLETE at offset 281
Assertion failed: (params.empty() || ((Key.Depth == params.back()>getDepth() && Key.Index == params.back()>getIndex() + 1) || (Key.Depth > params.back()->getDepth() && Key.Index == 0))), function addGenericParameter, file /Users/nathanhawes/workspace/open-swift-source-compat-suite/swift/lib/AST/GenericSignatureBuilder.cpp, line 4133.
0 swift-ide-test 0x000000011264ba98 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1 swift-ide-test 0x000000011264aa06 llvm::sys::RunSignalHandlers() + 198
2 swift-ide-test 0x000000011264c0b2 SignalHandler(int) + 258
3 libsystem_platform.dylib 0x00007fff7dd65f5a _sigtramp + 26
4 libsystem_platform.dylib 0x00007ff4d282d800 _sigtramp + 1420589248
5 libsystem_c.dylib 0x00007fff7db0f1ae abort + 127
6 libsystem_c.dylib 0x00007fff7dad71ac basename_r + 0
7 swift-ide-test 0x000000010f6fe8d8 swift::GenericSignatureBuilder::addGenericParameter(swift::GenericTypeParamType*) + 488
8 swift-ide-test 0x000000010f76d11b substType(swift::Type, llvm::function_ref<swift::Type (swift::SubstitutableType*)>, llvm::function_ref<llvm::Optional<swift::ProtocolConformanceRef> (swift::CanType, swift::Type, swift::ProtocolDecl*)>, swift::SubstOptions) + 2123
9 swift-ide-test 0x000000010f766906 swift::Type::subst(swift::SubstitutionMap, swift::SubstOptions) const + 118
10 swift-ide-test 0x000000010f0df302 (anonymous namespace)::CompletionLookup::getTypeOfMember(swift::ValueDecl const*, llvm::Optional<swift::Type>) + 434
11 swift-ide-test 0x000000010f0dd434 (anonymous namespace)::CompletionLookup::addMethodCall(swift::FuncDecl const*, swift::DeclVisibilityKind) + 324
12 swift-ide-test 0x000000010f0da079 (anonymous namespace)::CompletionLookup::FilteredDeclConsumer::foundDecl(swift::ValueDecl*, swift::DeclVisibilityKind) + 73
13 swift-ide-test 0x000000010f7276b0 lookupVisibleMemberDecls(swift::Type, swift::VisibleDeclConsumer&, swift::DeclContext const*, (anonymous namespace)::LookupState, swift::DeclVisibilityKind, swift::LazyResolver*, swift::GenericSignatureBuilder*) + 752
14 swift-ide-test 0x000000010f727825 swift::lookupVisibleMemberDecls(swift::VisibleDeclConsumer&, swift::Type, swift::DeclContext const*, swift::LazyResolver*, bool, swift::GenericSignatureBuilder*) + 53
15 swift-ide-test 0x000000010f0d39ab (anonymous namespace)::CompletionLookup::getUnresolvedMemberCompletions(llvm::ArrayRef<swift::Type>) + 379
16 swift-ide-test 0x000000010f0e4ecd (anonymous namespace)::CompletionLookup::LookupByName::unboxType(swift::Type) + 637
17 swift-ide-test 0x000000010f726f91 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1121
18 swift-ide-test 0x000000010f0c9c21 (anonymous namespace)::CodeCompletionCallbacksImpl::doneParsing() + 7217
19 swift-ide-test 0x000000010f5c3130 (anonymous namespace)::ParseDelayedFunctionBodies::walkToDeclPre(swift::Decl*) + 304
20 swift-ide-test 0x000000010f67d22b (anonymous namespace)::Traversal::doIt(swift::Decl*) + 171
21 swift-ide-test 0x000000010f681f3b (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 475
22 swift-ide-test 0x000000010f67d258 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 216
23 swift-ide-test 0x000000010f67d16b swift::Decl::walk(swift::ASTWalker&) + 27
24 swift-ide-test 0x000000010f73729a swift::SourceFile::walk(swift::ASTWalker&) + 170
25 swift-ide-test 0x000000010f735baf swift::ModuleDecl::walk(swift::ASTWalker&) + 95
26 swift-ide-test 0x000000010f5bc257 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 215
27 swift-ide-test 0x000000010f0b03c9 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 1081
28 swift-ide-test 0x000000010f0af650 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 512
29 swift-ide-test 0x000000010f0342c8 main + 29032
30 libdyld.dylib 0x00007fff7da63015 start + 1
31 libdyld.dylib 0x0000000000000005 start + 2186924017
Stack dump:
0. Program arguments: build/compat_macos/swift-macosx-x86_64/bin/swift-ide-test -code-completion -code-completion-token=COMPLETE -source-filename /tmp/test.swift

  1. While walking into decl 'Foo' at /tmp/test.swift:7:1
    Abort trap: 6
@nathawes
Copy link
Collaborator Author

@swift-ci create

@rintaro
Copy link
Mannequin

rintaro mannequin commented Aug 11, 2018

#18626

@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