Skip to content

[SIL] Add test case for crash triggered in swift::DependentGenericTypeResolver::resolveSelfAssociatedType(…) #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2015
Merged

[SIL] Add test case for crash triggered in swift::DependentGenericTypeResolver::resolveSelfAssociatedType(…) #686

merged 1 commit into from
Dec 20, 2015

Conversation

practicalswift
Copy link
Contributor

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"

…eResolver::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"
```
gribozavr added a commit that referenced this pull request Dec 20, 2015
…nerictyperesolver-resolveselfassociatedtype

[SIL] Add test case for crash triggered in swift::DependentGenericTypeResolver::resolveSelfAssociatedType(…)
@gribozavr gribozavr merged commit 9381b20 into swiftlang:master Dec 20, 2015
MaxDesiatov pushed a commit to MaxDesiatov/swift that referenced this pull request May 1, 2020
…in-to-thick

Revert thunk emission code completely
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants