Skip to content

Commit dd1e0d7

Browse files
authored
Merge pull request #81835 from hamishknight/fuzzy
[test] Add some known type-checker + parser crashers
2 parents e7e4c35 + b7d26fd commit dd1e0d7

36 files changed

+165
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// {"signature":"swift::rewriting::RewriteContext::finishComputingRequirementSignatures(swift::ProtocolDecl const*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a : b where c == d<e> protocol f : g protocol g {
4+
associatedtype 2 : a
5+
}
6+
struct d < e extension d
7+
: f protocol h{associatedtype e associatedtype c : g} protocol b : h
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// {"signature":"swift::PackExpansionType::PackExpansionType(swift::Type, swift::Type, swift::RecursiveTypeProperties, swift::ASTContext const*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
struct a < each b {
4+
struct c {
5+
d : (repeat(each b
6+
func e {
7+
c(&0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"(anonymous namespace)::ABIDependencyEvaluator::computeABIDependenciesForModule(swift::ModuleDecl*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
switch {
4+
case init
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"getTypeForSymbolRange(swift::rewriting::Symbol const*, swift::rewriting::Symbol const*, llvm::ArrayRef<swift::GenericTypeParamType*>, swift::rewriting::PropertyMap const&)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
// REQUIRES: OS=macosx
4+
import Combine extension Publishers.Share{a <b , c where Upstream == Publishers.FlatMap <b, c>{func a <c where Upstream == Publishers.FlatMap <b, c>, c.Output ==
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::rewriting::RequirementMachine::verify(swift::rewriting::MutableTerm const&) const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a {
4+
typealias Index extension Collection where Self : a{b : Index} protocol a
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::DeclContext::getASTContext() const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
@a({ struct b }
4+
var c
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"signature":"swift::Type llvm::function_ref<swift::Type (swift::SubstitutableType*)>::callback_fn<swift::TypeResolution::applyUnboundGenericArguments(swift::GenericTypeDecl*, swift::Type, swift::SourceLoc, llvm::ArrayRef<swift::Type>) const::$_0 const>(long, swift::SubstitutableType*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol a extension a {
4+
class b {
5+
struct c < f struct d func e->c<d>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"(anonymous namespace)::TypeSubstituter::transformDependentMemberType(swift::DependentMemberType*, swift::TypePosition)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
// REQUIRES: OS=macosx
4+
import Combine extension Publishers.Share where Upstream == {a <b , c > where Upstream == Publishers.FlatMap <b, c>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::Lexer::formEscapedIdentifierToken(char const*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
``
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::ast_scope::ASTScopeImpl::printRange(llvm::raw_ostream&) const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
func a < >>

0 commit comments

Comments
 (0)