Skip to content

Commit a107086

Browse files
[swiftc] Add 💥 case (😢 → 55, 😀 → 5095) triggered in swift::Type::getString(…)
Add crash case with stack trace: ``` swift: /path/to/swift/lib/AST/ASTPrinter.cpp:4061: void (anonymous namespace)::TypePrinter::visitArchetypeType(swift::ArchetypeType *): Assertion `GTD && GTD->isProtocolSelf()' failed. 12 swift 0x0000000001037313 swift::Type::getString(swift::PrintOptions const&) const + 163 13 swift 0x0000000000f62ad4 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 2244 14 swift 0x0000000000f67bfe swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 3998 15 swift 0x0000000000e9a3c2 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>) + 850 16 swift 0x0000000000ea0b22 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610 17 swift 0x0000000000ea1cd7 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343 18 swift 0x0000000000ea1eeb swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267 20 swift 0x0000000000eb25a6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 23 swift 0x0000000000f1888a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346 24 swift 0x0000000000f186ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46 25 swift 0x0000000000f192b3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179 27 swift 0x0000000000ed4851 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281 28 swift 0x0000000000c62209 swift::CompilerInstance::performSema() + 3289 30 swift 0x00000000007d89b9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857 31 swift 0x00000000007a49f8 main + 2872 Stack dump: 0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28340-swift-type-getstring.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28340-swift-type-getstring-e49a2a.o 1. While type-checking 'a' at validation-test/compiler_crashers/28340-swift-type-getstring.swift:18:1 2. While type-checking declaration 0x4e90678 at validation-test/compiler_crashers/28340-swift-type-getstring.swift:18:8 3. While type-checking expression at [validation-test/compiler_crashers/28340-swift-type-getstring.swift:18:14 - line:18:14] RangeText="1" <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: compile command failed due to signal (use -v to see invocation) ```
1 parent eef56b5 commit a107086

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
{
11+
protocol P{
12+
enum b{{{
13+
}}
14+
case
15+
}
16+
typealias d
17+
class A{
18+
func a{let:d=1

0 commit comments

Comments
 (0)