-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Commit e48323c
committed
[SIL] Add test case for crash triggered in swift::DependentGenericTypeResolver::resolveSelfAssociatedType(swift::Type, swift::DeclContext*, swift::AssociatedTypeDecl*)
Stack trace:
```
<stdin>:2:23: error: expected '>' to complete generic parameter list
protocol O{func f(<u,a{},a.i
^
<stdin>:2:19: note: to match this opening '<'
protocol O{func f(<u,a{},a.i
^
<stdin>:2:23: error: expected parameter type following ':'
protocol O{func f(<u,a{},a.i
^
<stdin>:2:23: error: expected ',' separator
protocol O{func f(<u,a{},a.i
^
,
<stdin>:2:23: error: expected parameter type following ':'
protocol O{func f(<u,a{},a.i
^
<stdin>:2:23: error: expected ',' separator
protocol O{func f(<u,a{},a.i
^
,
<stdin>:2:26: error: unnamed parameters must be written with the empty name '_'
protocol O{func f(<u,a{},a.i
^
_:
<stdin>:2:29: error: expected ',' separator
protocol O{func f(<u,a{},a.i
^
,
<stdin>:2:29: error: expected parameter type following ':'
protocol O{func f(<u,a{},a.i
^
<stdin>:2:29: error: expected ',' separator
protocol O{func f(<u,a{},a.i
^
,
<stdin>:2:29: error: consecutive declarations on a line must be separated by ';'
protocol O{func f(<u,a{},a.i
^
;
<stdin>:2:29: error: expected declaration
protocol O{func f(<u,a{},a.i
^
<unknown>:0: error: type annotation missing in pattern
sil-opt: /path/to/swift/lib/Sema/TypeCheckGeneric.cpp:34: virtual swift::Type swift::DependentGenericTypeResolver::resolveDependentMemberType(swift::Type, swift::DeclContext *, swift::SourceRange, swift::ComponentIdentTypeRepr *): Assertion `archetype && "Bad generic context nesting?"' failed.
8 sil-opt 0x0000000000ab8550 swift::DependentGenericTypeResolver::resolveSelfAssociatedType(swift::Type, swift::DeclContext*, swift::AssociatedTypeDecl*) + 0
10 sil-opt 0x0000000000ae6bde swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
12 sil-opt 0x0000000000ae6ad4 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 212
14 sil-opt 0x0000000000abeee1 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 721
15 sil-opt 0x0000000000abee38 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 552
17 sil-opt 0x0000000000ab91cc swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 124
22 sil-opt 0x0000000000a9aaf7 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 151
23 sil-opt 0x0000000000a66322 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
24 sil-opt 0x00000000007392c2 swift::CompilerInstance::performSema() + 2946
25 sil-opt 0x0000000000723efc main + 1916
Stack dump:
0. Program arguments: sil-opt -enable-sil-verify-all
1. While type-checking 'O' at <stdin>:2:1
2. While resolving type a.i at [<stdin>:2:26 - line:2:28] RangeText="a.i"
```1 parent c7fe4c3 commit e48323cCopy full SHA for e48323c
File tree
Expand file treeCollapse file tree
1 file changed
+2
-0
lines changedFilter options
- validation-test/SIL/crashers
Expand file treeCollapse file tree
1 file changed
+2
-0
lines changedvalidation-test/SIL/crashers/012-swift-dependentgenerictyperesolver-resolveselfassociatedtype.sil
Copy file name to clipboard+2Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + |
0 commit comments