Skip to content

Commit b7fd2d1

Browse files
[swiftc] Add test case for crash triggered in swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc)
Stack trace: ``` swift: /path/to/swift/lib/Sema/CSGen.cpp:3315: bool swift::isExtensionApplied(swift::DeclContext &, swift::Type, const swift::ExtensionDecl *): Assertion `GenericParams.size() == GenericArgs.size()' failed. 12 swift 0x00000000010d0c86 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1174 13 swift 0x0000000000edc344 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 260 14 swift 0x0000000000e86f78 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3864 16 swift 0x000000000104e623 swift::Expr::walk(swift::ASTWalker&) + 19 17 swift 0x0000000000e87797 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 119 18 swift 0x0000000000e8e152 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 19 swift 0x0000000000e8f2a7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343 20 swift 0x0000000000e8f4bb swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267 27 swift 0x0000000000ea0546 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 28 swift 0x0000000000ec37f2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 994 29 swift 0x0000000000c58c79 swift::CompilerInstance::performSema() + 3289 31 swift 0x00000000007d6eef swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2863 32 swift 0x00000000007a2ef8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28299-swift-lookupvisibledecls.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28299-swift-lookupvisibledecls-cad1b5.o 1. While type-checking 'd' at validation-test/compiler_crashers/28299-swift-lookupvisibledecls.swift:12:1 2. While type-checking expression at [validation-test/compiler_crashers/28299-swift-lookupvisibledecls.swift:12:28 - line:12:28] RangeText="a" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ```
1 parent d54bb62 commit b7fd2d1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This source file is part of the Swift.org open source project
2+
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
3+
// Licensed under Apache License v2.0 with Runtime Library Exception
4+
//
5+
// See http://swift.org/LICENSE.txt for license information
6+
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
7+
8+
// RUN: not --crash %target-swift-frontend %s -parse
9+
// REQUIRES: asserts
10+
protocol A
11+
extension A
12+
class d<w{struct B:A{let b=a

0 commit comments

Comments
 (0)