Skip to content

Commit 7710bc6

Browse files
[SourceKit] Add test case for crash triggered in swift::constraints::Solution::resolveLocatorToDecl(swift::constraints::ConstraintLocator*) const
Stack trace: ``` found code completion token A at offset 145 swift-ide-test: /path/to/swift/lib/Sema/CSApply.cpp:90: swift::Type swift::constraints::Solution::computeSubstitutions(swift::Type, swift::DeclContext *, swift::Type, swift::constraints::ConstraintLocator *, SmallVectorImpl<swift::Substitution> &) const: Assertion `openedTypes != OpenedTypes.end() && "Missing opened type information"' failed. 9 swift-ide-test 0x0000000000acae49 swift::constraints::Solution::resolveLocatorToDecl(swift::constraints::ConstraintLocator*) const + 1593 10 swift-ide-test 0x0000000000a12acb swift::TypeChecker::getTypeOfExpressionWithoutApplying(swift::Expr*&, swift::DeclContext*, swift::ConcreteDeclRef&, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*) + 443 12 swift-ide-test 0x0000000000a4dd73 swift::getTypeOfCompletionContextExpr(swift::ASTContext&, swift::DeclContext*, swift::CompletionTypeCheckKind, swift::Expr*&, swift::ConcreteDeclRef&) + 691 16 swift-ide-test 0x0000000000c5ade4 swift::Decl::walk(swift::ASTWalker&) + 20 17 swift-ide-test 0x0000000000caf36e swift::SourceFile::walk(swift::ASTWalker&) + 174 18 swift-ide-test 0x0000000000cae67f swift::ModuleDecl::walk(swift::ASTWalker&) + 95 19 swift-ide-test 0x0000000000c851f4 swift::DeclContext::walkContext(swift::ASTWalker&) + 180 20 swift-ide-test 0x00000000009884f8 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136 21 swift-ide-test 0x00000000008388f1 swift::CompilerInstance::performSema() + 3697 22 swift-ide-test 0x00000000007d9111 main + 42417 Stack dump: 0. Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE> 1. While walking into decl 'b' at <INPUT-FILE>:4:1 2. While type-checking expression at [<INPUT-FILE>:4:8 - line:4:8] RangeText="b" ```
1 parent 8d6b8df commit 7710bc6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s
2+
// REQUIRES: asserts
3+
protocol b
4+
func b{b#^A^#

0 commit comments

Comments
 (0)