Commit Graph

3633 Commits

Author SHA1 Message Date
Dmitri Gribenko
a3254b7990 Foundation: add custom AnyHashable representations to NSNumber and NSString
We want NSNumbers bridged from Swift types to bridge back to the same
Swift type.
2016-07-26 03:10:52 -07:00
Dmitri Gribenko
ece14ccc2e stdlib: add convenience APIs for Set<AnyHashable> and Dictionary<AnyHashable, *>
Implements SE-0131 "Add AnyHashable to the standard library".
2016-07-26 03:10:52 -07:00
Dmitri Gribenko
53c424409d stdlib: add AnyHashable
Implements SE-0131 "Add AnyHashable to the standard library".
2016-07-26 03:10:52 -07:00
Dmitri Gribenko
9ac1bb108a StdlibUnitttest: optimize checkEquatable()
checkEquatable() used to be O(n^3), now it is O(n^2).
2016-07-26 03:10:52 -07:00
Andrew Trick
0ed9ee8dee Revert "Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)"
This reverts commit ece0951924.

This results in lldb failues on linux that I can't readily debug.
Backing out until they can be resolved.
2016-07-26 02:50:57 -07:00
Andrew Trick
b65244805a Revert "Minor bug in the SceneKit validation test."
This reverts commit 8321a287de.

This depends on the UnsafeRawPointer migration.
2016-07-26 02:50:35 -07:00
Andrew Trick
8321a287de Minor bug in the SceneKit validation test. 2016-07-26 02:24:20 -07:00
Andrew Trick
ece0951924 Migrate from UnsafePointer<Void> to UnsafeRawPointer. (#3724)
* Migrate from `UnsafePointer<Void>` to `UnsafeRawPointer`.

As proposed in SE-0107: UnsafeRawPointer.

`void*` imports as `UnsafeMutableRawPointer`.
`const void*` imports as `UnsafeRawPointer`.

Occurrences of `UnsafePointer<Void>` are replaced with UnsafeRawPointer.

* Migrate overlays from UnsafePointer<Void> to UnsafeRawPointer.

This requires explicit memory binding in several places,
particularly in NSData and CoreAudio.

* Fix a bunch of test cases for Void->Raw migration.

* qsort takes IUO values

* Bridge `Unsafe[Mutable]RawPointer as `void [const] *`.

* Parse #dsohandle as UnsafeMutableRawPointer

* Update a bunch of test cases for Void->Raw migration.

* Trivial fix for the SceneKit test case.

* Add an UnsafeRawPointer self initializer.

This is unfortunately necessary for assignment between types imported from C.

* Tiny simplification of the initializer.
2016-07-26 02:18:21 -07:00
David Farler
7bfaeb57f1 [SE-0081] Warn on deprecated where clause inside angle brackets
and provide a fix-it to move it to the new location as referenced
in SE-0081.

Fix up a few stray places in the standard library that is still using
the old syntax.

Update any ./test files that aren't expecting the new warning/fix-it
in -verify mode.

While investigating what I thought was a new crash due to this new
diagnostic, I discovered two sources of quite a few compiler crashers
related to unterminated generic parameter lists, where the right
angle bracket source location was getting unconditionally set to
the current token, even though it wasn't actually a '>'.
2016-07-26 01:41:10 -07:00
Slava Pestov
1ae8e37058 Remove -enable-protocol-typealiases staging flag
It looks like migration fixits are done, and this doesn't
expose any new bugs that were not possible before, because
you could already define typealiases inside protocol
extensions.

To prevent some compiler_crasher regressions, add a simple
circularity-breaking hack. I'll need to do a sweep to clean
these up some day soon.
2016-07-25 23:18:49 -07:00
Joe Groff
10a0eb1c13 Merge pull request #3710 from jckarter/turn-on-id-as-any
Turn on id as any
2016-07-25 18:58:27 -07:00
Manav Gabhawala
d06d4e5ad7 [AST][Sema] Fixes the IterativeTypeChecker and better manages circular protocol inheritance
The IterativeTypeChecker now use loops instead of recursion to help keep the stack size low
We diagnose circular dependencies for protocols in a more efficient manner and also prevent the possibility of infinite loops
2016-07-25 13:13:13 -07:00
Joe Groff
920b1f4df2 Work around Linux-only ambiguities using Array.reversed in validation-test/stdlib/Stride.swift. 2016-07-25 07:32:08 -07:00
Joe Groff
f1c0334d29 Autoreleasepool NSDictionary conversions in Dictionary validation tests.
Not sure if this is by design (cc @gribozavr), but the test harness counts the bridged values in these dictionaries as "leaks" if they aren't popped early.
2016-07-25 07:25:47 -07:00
Joe Groff
21c15d8fe9 Update validation tests for id-as-Any. 2016-07-25 06:40:37 -07:00
swift-ci
e657ece02b Merge pull request #3617 from natecook1000/nc-existenz-identity 2016-07-24 23:31:40 -07:00
practicalswift
a6edf8b63a Merge pull request #3718 from practicalswift/swiftc-28378-swift-typechecker-resolvewitness
[swiftc (73 vs. 5115)] Add crasher in swift::TypeChecker::resolveWitness(...)
2016-07-24 14:22:47 +02:00
Dmitri Gribenko
558f2b8591 Merge pull request #3517 from natecook1000/nc-SE-0120
[stdlib] Implement partition API change (SE-0120)
2016-07-24 01:43:02 -07:00
practicalswift
66cdce98d0 [swiftc (73 vs. 5115)] Add crasher in swift::TypeChecker::resolveWitness(...)
Add test case for crash triggered in `swift::TypeChecker::resolveWitness(...)`.

Current number of unresolved compiler crashers: 73 (5115 resolved)

Assertion failure in [`lib/Sema/CSApply.cpp (line 148)`](https://github.com/apple/swift/blob/master/lib/Sema/CSApply.cpp#L148):

```
Assertion `(conforms || replacement->is<ErrorType>() || firstArchetype->getIsRecursive() || isOpenedAnyObject(replacement) || replacement->is<GenericTypeParamType>()) && "Constraint system missed a conformance?"' failed.

When executing: swift::Type swift::constraints::Solution::computeSubstitutions(swift::Type, swift::DeclContext *, swift::Type, swift::constraints::ConstraintLocator *, SmallVectorImpl<swift::Substitution> &) const
```

Assertion context:

```
      assert((conforms ||
              replacement->is<ErrorType>() ||
              firstArchetype->getIsRecursive() ||
              isOpenedAnyObject(replacement) ||
              replacement->is<GenericTypeParamType>()) &&
             "Constraint system missed a conformance?");
      (void)conforms;

      assert(conformance ||
             replacement->is<ErrorType>() ||
             replacement->hasDependentProtocolConformances());
```
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:148: swift::Type swift::constraints::Solution::computeSubstitutions(swift::Type, swift::DeclContext *, swift::Type, swift::constraints::ConstraintLocator *, SmallVectorImpl<swift::Substitution> &) const: Assertion `(conforms || replacement->is<ErrorType>() || firstArchetype->getIsRecursive() || isOpenedAnyObject(replacement) || replacement->is<GenericTypeParamType>()) && "Constraint system missed a conformance?"' failed.
14 swift           0x0000000000f1428c swift::TypeChecker::resolveWitness(swift::NormalProtocolConformance const*, swift::ValueDecl*) + 668
15 swift           0x000000000113166b swift::NormalProtocolConformance::getWitness(swift::ValueDecl*, swift::LazyResolver*) const + 171
16 swift           0x0000000000f13c20 swift::TypeChecker::findWitnessedObjCRequirements(swift::ValueDecl const*, bool) + 368
32 swift           0x0000000000ec9406 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
35 swift           0x0000000000f3182a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
36 swift           0x0000000000f3168e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
37 swift           0x0000000000f32253 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
39 swift           0x0000000000eecb01 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
40 swift           0x0000000000c73279 swift::CompilerInstance::performSema() + 3289
42 swift           0x00000000007d94b7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
43 swift           0x00000000007a54b8 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28378-swift-typechecker-resolvewitness.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28378-swift-typechecker-resolvewitness-1fc026.o
1.	While type-checking '<' at validation-test/compiler_crashers/28378-swift-typechecker-resolvewitness.swift:10:1
2.	While type-checking 'C' at validation-test/compiler_crashers/28378-swift-typechecker-resolvewitness.swift:10:13
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-07-24 01:30:29 +02:00
Andrew Trick
ecc6bd51ad Type system support for raw pointer conversion. (#3685)
* [Type System] Handle raw pointer conversion.

As proposed in SE-0107: UnsafeRawPointer.
https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md#implicit-argument-conversion

UnsafeMutablePointer<T> -> UnsafeMutableRawPointer
UnsafeMutablePointer<T> -> UnsafeRawPointer
UnsafePointer<T> -> UnsafeRawPointer
UnsafeMutableRawPointer -> UnsafeRawPointer

inout:
&anyVar -> UnsafeMutableRawPointer
&anyVar -> UnsafeRawPointer

array -> UnsafeRawPointer
string -> UnsafeRawPointer

varArray -> UnsafeMutableRawPointer

* Rename expectEqual(_, _, sameValue:) to expectEqualTest to workaround a type system bug.

<rdar://26058520> Generic type constraints incorrectly applied to functions with the same name

This is exposed by additions to the type system for UnsafeRawPointer.

Warning: unit tests fail very confusingly without this fix.
2016-07-23 11:30:49 -07:00
swift-ci
765ddb0f87 Merge pull request #3713 from practicalswift/sourcekit-082-swift-typebase-gatherallsubstitutions 2016-07-23 11:26:02 -07:00
swift-ci
db94636896 Merge pull request #3714 from practicalswift/sil-032-swift-iterativetypechecker-satisfy 2016-07-23 11:26:01 -07:00
practicalswift
f9b09a8590 [SourceKit] Add test case for crash triggered in swift::DeclContext::getGenericParamsOfContext() const
Stack trace:

```
found code completion token A at offset 157
4  swift-ide-test  0x0000000000c29727 swift::DeclContext::getGenericParamsOfContext() const + 23
5  swift-ide-test  0x0000000000b428f0 swift::ArchetypeBuilder::mapTypeOutOfContext(swift::DeclContext const*, swift::Type) + 16
6  swift-ide-test  0x0000000000c46e6c swift::Mangle::Mangler::mangleType(swift::Type, unsigned int) + 4156
7  swift-ide-test  0x0000000000c48142 swift::Mangle::Mangler::mangleDeclType(swift::ValueDecl const*, unsigned int) + 242
8  swift-ide-test  0x0000000000c4528d swift::Mangle::Mangler::mangleNominalType(swift::NominalTypeDecl const*) + 157
9  swift-ide-test  0x0000000000c862c8 swift::ide::printDeclUSR(swift::ValueDecl const*, llvm::raw_ostream&) + 840
11 swift-ide-test  0x00000000007af6d8 copyAssociatedUSRs(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, swift::Decl const*) + 104
12 swift-ide-test  0x00000000007b055c swift::ide::CodeCompletionResultBuilder::takeResult() + 1676
16 swift-ide-test  0x0000000000c3f912 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 562
23 swift-ide-test  0x0000000000bbbd34 swift::Decl::walk(swift::ASTWalker&) + 20
24 swift-ide-test  0x0000000000c5449e swift::SourceFile::walk(swift::ASTWalker&) + 174
25 swift-ide-test  0x0000000000c535df swift::ModuleDecl::walk(swift::ASTWalker&) + 79
26 swift-ide-test  0x0000000000c2a6db swift::DeclContext::walkContext(swift::ASTWalker&) + 187
27 swift-ide-test  0x00000000008eeb68 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
28 swift-ide-test  0x00000000007a6efd swift::CompilerInstance::performSema() + 3597
29 swift-ide-test  0x000000000074a181 main + 34609
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl 'B' at <INPUT-FILE>:3:1
```
2016-07-23 18:25:06 +02:00
practicalswift
5b88f42826 [SIL] Add test case for crash triggered in swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest)
Stack trace:

```
<stdin>:3:12: error: expected '=' in typealias declaration
typealias E:<__>__
           ^
           =
<stdin>:3:13: error: only syntactic function types can be generic
typealias E:<__>__
            ^
sil-opt: /path/to/swift/lib/Sema/IterativeTypeChecker.cpp:103: void swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest): Assertion `isSatisfied(request)' failed.
9  sil-opt         0x0000000000bff669 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
12 sil-opt         0x0000000000aeac64 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3396
15 sil-opt         0x0000000000aef886 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
16 sil-opt         0x0000000000b13f92 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
17 sil-opt         0x00000000007726e9 swift::CompilerInstance::performSema() + 3289
18 sil-opt         0x000000000075bb9d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	While type-checking 'E' at <stdin>:3:1
2.	While type-checking 'E' at <stdin>:3:1
```
2016-07-23 18:20:57 +02:00
practicalswift
dc12333b36 [SourceKit] Add test case for crash triggered in llvm::llvm_unreachable_internal(char const*, char const*, unsigned int)
Stack trace:

```
found code completion token A at offset 162
Not a nominal or bound generic type
UNREACHABLE executed at /path/to/swift/lib/AST/Module.cpp:642!
6  swift-ide-test  0x0000000002eca1cd llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461
7  swift-ide-test  0x0000000000c4fbae swift::TypeBase::gatherAllSubstitutions(swift::ModuleDecl*, swift::LazyResolver*, swift::DeclContext*) + 4398
8  swift-ide-test  0x0000000000c76ec1 swift::TypeBase::getSuperclass(swift::LazyResolver*) + 193
17 swift-ide-test  0x0000000000bbbd34 swift::Decl::walk(swift::ASTWalker&) + 20
18 swift-ide-test  0x0000000000c5449e swift::SourceFile::walk(swift::ASTWalker&) + 174
19 swift-ide-test  0x0000000000c535df swift::ModuleDecl::walk(swift::ASTWalker&) + 79
20 swift-ide-test  0x0000000000c2a6db swift::DeclContext::walkContext(swift::ASTWalker&) + 187
21 swift-ide-test  0x00000000008eeb68 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
22 swift-ide-test  0x00000000007a6efd swift::CompilerInstance::performSema() + 3597
23 swift-ide-test  0x000000000074a181 main + 34609
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl 'B' at <INPUT-FILE>:3:1
```
2016-07-23 18:20:22 +02:00
swift-ci
5fbb9cf008 Merge pull request #3712 from practicalswift/sil-031-swift-typechecker-configureinterfacetype 2016-07-23 08:45:43 -07:00
swift-ci
3512dc809e Merge pull request #3711 from practicalswift/sourcekit-081-swift-genericsignature-getsubstitutionmap 2016-07-23 08:44:44 -07:00
Michael Gottesman
ade62cb4fb Merge pull request #3708 from practicalswift/sourcekit-080-swift-valuedecl-getinterfacetype
[SourceKit] Add test case for crash triggered in swift::ValueDecl::getInterfaceType()
2016-07-23 08:10:24 -07:00
practicalswift
ed360c904e [SIL] Add test case for crash triggered in swift::TypeChecker::configureInterfaceType(swift::AbstractFunctionDecl*)
Stack trace:

```
<stdin>:3:7: error: expected '(' in argument list of function declaration
func y:@opened(Any
      ^
<stdin>:3:7: error: expected '->' after function parameter tuple
func y:@opened(Any
      ^
      ->
<stdin>:3:16: error: known id for 'opened' attribute must be a UUID string
func y:@opened(Any
               ^
<stdin>:3:16: error: expected ')' after id value for 'opened' attribute
func y:@opened(Any
               ^
<stdin>:3:15: note: to match this opening '('
func y:@opened(Any
              ^
sil-opt: /path/to/swift/lib/Sema/TypeCheckGeneric.cpp:650: void swift::TypeChecker::configureInterfaceType(swift::AbstractFunctionDecl *): Assertion `!funcTy->hasArchetype()' failed.
8  sil-opt         0x0000000000b2aedf swift::TypeChecker::configureInterfaceType(swift::AbstractFunctionDecl*) + 2047
11 sil-opt         0x0000000000aef886 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
12 sil-opt         0x0000000000b13f92 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
13 sil-opt         0x00000000007726e9 swift::CompilerInstance::performSema() + 3289
14 sil-opt         0x000000000075bb9d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	While type-checking 'y' at <stdin>:3:1
```
2016-07-23 16:42:20 +02:00
practicalswift
120908e069 [SourceKit] Add test case for crash triggered in swift::GenericSignature::getSubstitutionMap(llvm::ArrayRef<swift::Substitution>) const
Stack trace:

```
found code completion token A at offset 170
swift-ide-test: /path/to/llvm/include/llvm/ADT/ArrayRef.h:139: const T &llvm::ArrayRef<swift::Substitution>::front() const [T = swift::Substitution]: Assertion `!empty()' failed.
8  swift-ide-test  0x0000000000c3bb56 swift::GenericSignature::getSubstitutionMap(llvm::ArrayRef<swift::Substitution>) const + 566
9  swift-ide-test  0x0000000000a09d01 swift::createDesignatedInitOverride(swift::TypeChecker&, swift::ClassDecl*, swift::ConstructorDecl*, swift::DesignatedInitKind) + 385
10 swift-ide-test  0x000000000098cde2 swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 3250
13 swift-ide-test  0x0000000000986ee6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
16 swift-ide-test  0x00000000009efc4a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
17 swift-ide-test  0x00000000009efaae swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
18 swift-ide-test  0x00000000009adb0f swift::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 655
23 swift-ide-test  0x0000000000bbbd34 swift::Decl::walk(swift::ASTWalker&) + 20
24 swift-ide-test  0x0000000000c5449e swift::SourceFile::walk(swift::ASTWalker&) + 174
25 swift-ide-test  0x0000000000c535df swift::ModuleDecl::walk(swift::ASTWalker&) + 79
26 swift-ide-test  0x0000000000c2a6db swift::DeclContext::walkContext(swift::ASTWalker&) + 187
27 swift-ide-test  0x00000000008eeb68 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
28 swift-ide-test  0x00000000007a6efd swift::CompilerInstance::performSema() + 3597
29 swift-ide-test  0x000000000074a181 main + 34609
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl getter for a at <INPUT-FILE>:3:6
2.	While type-checking 'A' at <INPUT-FILE>:3:36
```
2016-07-23 16:42:05 +02:00
practicalswift
f047c00bb1 [SIL] Add test case for crash triggered in swift::TypeChecker::checkDeclAttributes(swift::Decl*)
Stack trace:

```
<stdin>:3:22: error: expected '(' in argument list of function declaration
@_specialize(h)func f
                     ^
5  sil-opt         0x0000000000c16941 swift::TypeChecker::checkDeclAttributes(swift::Decl*) + 49
8  sil-opt         0x0000000000aef886 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
9  sil-opt         0x0000000000b13f92 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
10 sil-opt         0x00000000007726e9 swift::CompilerInstance::performSema() + 3289
11 sil-opt         0x000000000075bb9d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	While type-checking 'f' at <stdin>:3:16
```
2016-07-23 13:31:09 +02:00
practicalswift
5b117c2f80 [SourceKit] Add test case for crash triggered in swift::ValueDecl::getInterfaceType() const
Stack trace:

```
found code completion token A at offset 159
swift-ide-test: /path/to/swift/lib/AST/Decl.cpp:1688: swift::Type swift::ValueDecl::getInterfaceType() const: Assertion `!isa<AbstractFunctionDecl>(this) && "functions should have an interface type"' failed.
8  swift-ide-test  0x0000000000c1d666 swift::ValueDecl::getInterfaceType() const + 422
9  swift-ide-test  0x0000000000c481cd swift::Mangle::Mangler::getDeclTypeForMangling(swift::ValueDecl const*, llvm::ArrayRef<swift::GenericTypeParamType*>&, unsigned int&, llvm::ArrayRef<swift::Requirement>&, llvm::SmallVectorImpl<swift::Requirement>&) + 93
10 swift-ide-test  0x0000000000c480c2 swift::Mangle::Mangler::mangleDeclType(swift::ValueDecl const*, unsigned int) + 114
11 swift-ide-test  0x0000000000c86321 swift::ide::printDeclUSR(swift::ValueDecl const*, llvm::raw_ostream&) + 929
13 swift-ide-test  0x00000000007af6d8 copyAssociatedUSRs(llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator, 4096ul, 4096ul>&, swift::Decl const*) + 104
14 swift-ide-test  0x00000000007b055c swift::ide::CodeCompletionResultBuilder::takeResult() + 1676
18 swift-ide-test  0x0000000000c3f7e0 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 256
23 swift-ide-test  0x0000000000bbbd34 swift::Decl::walk(swift::ASTWalker&) + 20
24 swift-ide-test  0x0000000000c5449e swift::SourceFile::walk(swift::ASTWalker&) + 174
25 swift-ide-test  0x0000000000c535df swift::ModuleDecl::walk(swift::ASTWalker&) + 79
26 swift-ide-test  0x0000000000c2a6db swift::DeclContext::walkContext(swift::ASTWalker&) + 187
27 swift-ide-test  0x00000000008eeb68 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
28 swift-ide-test  0x00000000007a6efd swift::CompilerInstance::performSema() + 3597
29 swift-ide-test  0x000000000074a181 main + 34609
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl getter for a at <INPUT-FILE>:3:6
```
2016-07-23 13:30:53 +02:00
practicalswift
d9e22cadc6 Merge pull request #3707 from practicalswift/sourcekit-079-swift-archetypebuilder-maptypeoutofcontext
[SourceKit] Add test case for crash triggered in swift::ArchetypeBuilder::mapTypeOutOfContext(…)
2016-07-23 13:23:44 +02:00
practicalswift
0294eaa1b2 Merge pull request #3706 from practicalswift/sil-029-swift-parser-parsesilscope
[SIL] Add test case for crash triggered in swift::Parser::parseSILScope()
2016-07-23 13:23:38 +02:00
practicalswift
89c42cc7c1 [swiftc (72 vs. 5115)] Add crasher in swift::Expr::walk(...)
Add test case for crash triggered in `swift::Expr::walk(...)`.

Current number of unresolved compiler crashers: 72 (5115 resolved)

Assertion failure in [`lib/Sema/CSApply.cpp (line 683)`](https://github.com/apple/swift/blob/master/lib/Sema/CSApply.cpp#L683):

```
Assertion `baseTy->isAnyExistentialType() && "Type must be existential"' failed.

When executing: swift::Expr *(anonymous namespace)::ExprRewriter::openExistentialReference(swift::Expr *, swift::ArchetypeType *, swift::ValueDecl *)
```

Assertion context:

```
      if (auto metaTy = baseTy->getAs<AnyMetatypeType>()) {
        isMetatype = true;
        baseTy = metaTy->getInstanceType();
      }

      assert(baseTy->isAnyExistentialType() && "Type must be existential");

      // If the base was an lvalue but it will only be treated as an
      // rvalue, turn the base into an rvalue now. This results in
      // better SILGen.
      if (isLValue &&
```
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:683: swift::Expr *(anonymous namespace)::ExprRewriter::openExistentialReference(swift::Expr *, swift::ArchetypeType *, swift::ValueDecl *): Assertion `baseTy->isAnyExistentialType() && "Type must be existential"' failed.
13 swift           0x0000000001082adc swift::Expr::walk(swift::ASTWalker&) + 108
14 swift           0x0000000000f5e782 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 514
15 swift           0x0000000000eb74ea swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 778
16 swift           0x0000000000eb8600 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 352
17 swift           0x0000000000eb9325 swift::TypeChecker::typeCheckStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>&, swift::DeclContext*, swift::Diag<>) + 373
21 swift           0x0000000000f31c7d swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 845
22 swift           0x0000000000f31682 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 34
23 swift           0x0000000000f32253 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
25 swift           0x0000000000eecb01 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
26 swift           0x0000000000c73279 swift::CompilerInstance::performSema() + 3289
28 swift           0x00000000007d94b7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
29 swift           0x00000000007a54b8 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28377-swift-expr-walk.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28377-swift-expr-walk-38fbfa.o
1.	While type-checking 'init' at validation-test/compiler_crashers/28377-swift-expr-walk.swift:10:10
2.	While type-checking expression at [validation-test/compiler_crashers/28377-swift-expr-walk.swift:10:53 - line:10:57] RangeText="A().a"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-07-23 11:14:23 +02:00
practicalswift
1e1385c51b [SIL] Add test case for crash triggered in swift::Parser::parseSILScope()
Stack trace:

```
sil-opt: /path/to/swift/include/swift/Parse/Parser.h:412: swift::SourceLoc swift::Parser::consumeToken(swift::tok): Assertion `Tok.is(K) && "Consuming wrong token kind"' failed.
8  sil-opt         0x0000000000a62cae swift::Parser::parseSILScope() + 2478
9  sil-opt         0x0000000000a9835b swift::Parser::parseTopLevel() + 827
10 sil-opt         0x0000000000a51170 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 208
11 sil-opt         0x00000000007726c6 swift::CompilerInstance::performSema() + 3254
12 sil-opt         0x000000000075bb9d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	With parser at source location: <stdin>:3:12
```
2016-07-23 11:14:03 +02:00
practicalswift
091caab41e [SourceKit] Add test case for crash triggered in swift::ArchetypeBuilder::mapTypeOutOfContext(swift::ModuleDecl*, swift::GenericParamList*, swift::Type)
Stack trace:

```
found code completion token A at offset 152
swift-ide-test: /path/to/swift/lib/AST/ArchetypeBuilder.cpp:2086: static swift::Type swift::ArchetypeBuilder::mapTypeOutOfContext(swift::ModuleDecl *, swift::GenericParamList *, swift::Type): Assertion `!canType->hasTypeParameter() && "already have an interface type"' failed.
8  swift-ide-test  0x0000000000b42a35 swift::ArchetypeBuilder::mapTypeOutOfContext(swift::ModuleDecl*, swift::GenericParamList*, swift::Type) + 293
9  swift-ide-test  0x000000000098019f swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5471
10 swift-ide-test  0x00000000009c07f5 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 389
11 swift-ide-test  0x00000000009c2d09 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 265
12 swift-ide-test  0x00000000009816eb swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 363
17 swift-ide-test  0x0000000000986ee6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
18 swift-ide-test  0x00000000009ab6d2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
19 swift-ide-test  0x00000000007a6dc9 swift::CompilerInstance::performSema() + 3289
20 swift-ide-test  0x000000000074a181 main + 34609
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'B' at <INPUT-FILE>:3:1
```
2016-07-23 11:13:53 +02:00
practicalswift
9d12401a0f Merge pull request #3700 from practicalswift/sourcekit-078-swift-iterativetypechecker-processtypechecksuperclass
[SourceKit] Add test case for crash triggered in swift::IterativeTypeChecker::processTypeCheckSuperclass(…)
2016-07-23 11:12:59 +02:00
practicalswift
1665369fa9 Merge pull request #3562 from practicalswift/sil-027-swift-nominaltypedecl-getdeclaredtype
[SIL] Add test case for crash triggered in swift::NominalTypeDecl::getDeclaredType()
2016-07-23 11:10:49 +02:00
swift-ci
8b221e77a3 Merge pull request #3701 from practicalswift/swiftc-28376-swift-constraints-constraintsystem-diagnosefailureforexpr 2016-07-22 22:01:34 -07:00
practicalswift
4d201520ef Add REQUIRES line to reflect that the crash case seems to trigger under Linux only. 2016-07-23 05:51:02 +02:00
practicalswift
ac4d255f79 [SIL] Add test case for crash triggered in swift::NominalTypeDecl::getDeclaredType() const
Stack trace:

```
<stdin>:3:5: error: expected expression in list of expressions
bb0(@test_existential_metatype : $Int
    ^
<stdin>:3:5: error: expected ',' separator
bb0(@test_existential_metatype : $Int
    ^
    ,
<stdin>:3:5: error: expected ')' in expression list
bb0(@test_existential_metatype : $Int
    ^
<stdin>:3:4: note: to match this opening '('
bb0(@test_existential_metatype : $Int
   ^
<stdin>:3:1: error: expressions are not allowed at the top level
bb0(@test_existential_metatype : $Int
^
<stdin>:3:5: error: consecutive statements on a line must be separated by ';'
bb0(@test_existential_metatype : $Int
    ^
    ;
<stdin>:3:6: error: unknown attribute 'test_existential_metatype'
bb0(@test_existential_metatype : $Int
     ^
<stdin>:3:34: error: expected numeric value following '$'
bb0(@test_existential_metatype : $Int
                                 ^
<stdin>:3:32: error: expected declaration
bb0(@test_existential_metatype : $Int
                               ^
<stdin>:4:9: error: attribute can only be applied to types, not declarations
%0 to $@callee_owned (thin) -> ("01234567-cdef-> (thin) -> @owned @callee_owned (Int
        ^
<stdin>:4:22: error: expected declaration
%0 to $@callee_owned (thin) -> ("01234567-cdef-> (thin) -> @owned @callee_owned (Int
                     ^
<stdin>:4:33: error: unterminated string literal
%0 to $@callee_owned (thin) -> ("01234567-cdef-> (thin) -> @owned @callee_owned (Int
                                ^
<stdin>:7:1: error: expressions are not allowed at the top level
%0 : $@convention(thin) -> ()
^
<stdin>:7:3: error: consecutive statements on a line must be separated by ';'
%0 : $@convention(thin) -> ()
  ^
  ;
<stdin>:7:4: error: expected expression
%0 : $@convention(thin) -> ()
   ^
<stdin>:7:8: error: attribute can only be applied to types, not declarations
%0 : $@convention(thin) -> ()
       ^
<stdin>:7:18: error: expected declaration
%0 : $@convention(thin) -> ()
                 ^
<stdin>:8:20: error: expected numeric value following '$'
strong_retain %0 : $Beth
                   ^
<stdin>:10:8: error: attribute can only be applied to types, not declarations
%0 : $@box Int) : $@_TF6switch1aFT_T_ : $*Spoon
       ^
<stdin>:10:12: error: expected declaration
%0 : $@box Int) : $@_TF6switch1aFT_T_ : $*Spoon
           ^
<stdin>:10:21: error: unknown attribute '_TF6switch1aFT_T_'
%0 : $@box Int) : $@_TF6switch1aFT_T_ : $*Spoon
                    ^
<stdin>:10:39: error: expected declaration
%0 : $@box Int) : $@_TF6switch1aFT_T_ : $*Spoon
                                      ^
<stdin>:11:10: error: expected numeric value following '$'
bb0(%2 : $Builtin.FPIEEE64, 1) ()
         ^
<stdin>:12:16: error: attribute can only be applied to types, not declarations
sil [fragile] @guaranteed A)) {
               ^
<stdin>:12:27: error: expected declaration
sil [fragile] @guaranteed A)) {
                          ^
<stdin>:12:31: error: statement cannot begin with a closure expression
sil [fragile] @guaranteed A)) {
                              ^
<stdin>:12:31: note: explicitly discard the result of the closure by assigning to '_'
sil [fragile] @guaranteed A)) {
                              ^
                              _ =
<stdin>:12:31: error: expressions are not allowed at the top level
sil [fragile] @guaranteed A)) {
                              ^
<stdin>:12:31: error: braced block of statements is an unused closure
sil [fragile] @guaranteed A)) {
                              ^
<stdin>:14:5: error: initializers may only be declared within a type
init()
    ^
<stdin>:15:6: error: expected numeric value following '$'
%3 : $Builtin.Int32
     ^
<stdin>:15:1: error: expressions are not allowed at the top level
%3 : $Builtin.Int32
^
<stdin>:15:3: error: consecutive statements on a line must be separated by ';'
%3 : $Builtin.Int32
  ^
  ;
<stdin>:15:4: error: expected expression
%3 : $Builtin.Int32
   ^
<stdin>:16:20: error: expected a digit after integer literal prefix
inject_enum_addr %0a : $*Spoon
                   ^
<stdin>:18:2: error: attribute can only be applied to types, not declarations
@convention(thin) -> (Int, bb1, #Optional<Int) -> (thin) ()
 ^
<stdin>:18:12: error: expected declaration
@convention(thin) -> (Int, bb1, #Optional<Int) -> (thin) ()
           ^
<stdin>:19:6: error: expected numeric value following '$'
%0 : $Builtin.some!enumelt.Word) (thin) -> ()) (thin) ("01234567-> () (thin) -> Int) ()
     ^
<stdin>:19:56: error: unterminated string literal
%0 : $Builtin.some!enumelt.Word) (thin) -> ()) (thin) ("01234567-> () (thin) -> Int) ()
                                                       ^
<stdin>:20:16: error: expected numeric value following '$'
%6 = alloc_box $C
               ^
<stdin>:21:20: error: unknown attribute 'test_unreachable'
%5 = function_ref @test_unreachable : $C, @owned @box M
                   ^
<stdin>:21:39: error: expected numeric value following '$'
%5 = function_ref @test_unreachable : $C, @owned @box M
                                      ^
<stdin>:21:37: error: expected declaration
%5 = function_ref @test_unreachable : $C, @owned @box M
                                    ^
<stdin>:21:44: error: attribute can only be applied to types, not declarations
%5 = function_ref @test_unreachable : $C, @owned @box M
                                           ^
<stdin>:21:50: error: expected declaration
%5 = function_ref @test_unreachable : $C, @owned @box M
                                                 ^
<stdin>:21:51: error: attribute can only be applied to types, not declarations
%5 = function_ref @test_unreachable : $C, @owned @box M
                                                  ^
<stdin>:21:55: error: expected declaration
%5 = function_ref @test_unreachable : $C, @owned @box M
                                                      ^
<stdin>:24:27: error: unknown attribute 'test_checked_cast_br_jump_threading_with_entry_bb_arguments'
%1 = load_weak [fragile] @test_checked_cast_br_jump_threading_with_entry_bb_arguments : $@globalinit_func0 : $SomeSubclass
                          ^
<stdin>:24:87: error: expected declaration
%1 = load_weak [fragile] @test_checked_cast_br_jump_threading_with_entry_bb_arguments : $@globalinit_func0 : $SomeSubclass
                                                                                      ^
<stdin>:24:91: error: unknown attribute 'globalinit_func0'
%1 = load_weak [fragile] @test_checked_cast_br_jump_threading_with_entry_bb_arguments : $@globalinit_func0 : $SomeSubclass
                                                                                          ^
<stdin>:24:110: error: expected numeric value following '$'
%1 = load_weak [fragile] @test_checked_cast_br_jump_threading_with_entry_bb_arguments : $@globalinit_func0 : $SomeSubclass
                                                                                                             ^
<stdin>:24:108: error: expected declaration
%1 = load_weak [fragile] @test_checked_cast_br_jump_threading_with_entry_bb_arguments : $@globalinit_func0 : $SomeSubclass
                                                                                                           ^
<stdin>:25:1: error: statements are not allowed at the top level
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
^
<stdin>:25:24: error: consecutive statements on a line must be separated by ';'
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
                       ^
                       ;
<stdin>:25:25: error: expressions are not allowed at the top level
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
                        ^
<stdin>:25:42: error: consecutive statements on a line must be separated by ';'
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
                                         ^
                                         ;
<stdin>:25:44: error: attribute can only be applied to types, not declarations
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
                                           ^
<stdin>:25:57: error: expected declaration
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
                                                        ^
<stdin>:25:65: error: attribute can only be applied to types, not declarations
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
                                                                ^
<stdin>:25:78: error: expected declaration
return %2 = project_box %10 = functionref @callee_owned ()) : $@callee_owned ()
                                                                             ^
<stdin>:26:1: error: extraneous '}' at top level
}
^
<stdin>:27:19: error: expected expression in list of expressions
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
                  ^
<stdin>:27:19: error: expected ',' separator
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
                  ^
                 ,
<stdin>:27:19: error: expected ')' in expression list
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
                  ^
<stdin>:27:14: note: to match this opening '('
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
             ^
<stdin>:27:1: error: expressions are not allowed at the top level
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
^
<stdin>:27:18: error: consecutive statements on a line must be separated by ';'
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
                 ^
                 ;
<stdin>:27:20: error: unknown attribute '_TFSb21_getBuiltinLogicValuefSbFT_Bi1_'
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
                   ^
<stdin>:27:61: error: expected numeric value following '$'
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
                                                            ^
<stdin>:27:59: error: expected declaration
%115 = tuple (%1, @_TFSb21_getBuiltinLogicValuefSbFT_Bi1_ : $ImplicitlyUnwrappedOptional<Int8>
                                                          ^
<stdin>:28:8: error: unknown attribute '_TF6switch1cFT_T_'
%v : $@_TF6switch1cFT_T_ : $Int32) (thin) (thin) () : $@callee_owned ()) -0123-> ()
       ^
<stdin>:28:28: error: expected numeric value following '$'
%v : $@_TF6switch1cFT_T_ : $Int32) (thin) (thin) () : $@callee_owned ()) -0123-> ()
                           ^
<stdin>:28:26: error: expected declaration
%v : $@_TF6switch1cFT_T_ : $Int32) (thin) (thin) () : $@callee_owned ()) -0123-> ()
                         ^
<stdin>:28:57: error: attribute can only be applied to types, not declarations
%v : $@_TF6switch1cFT_T_ : $Int32) (thin) (thin) () : $@callee_owned ()) -0123-> ()
                                                        ^
<stdin>:28:70: error: expected declaration
%v : $@_TF6switch1cFT_T_ : $Int32) (thin) (thin) () : $@callee_owned ()) -0123-> ()
                                                                     ^
<stdin>:29:34: error: attribute can only be applied to types, not declarations
store %33 = alloc_ref [fragile] @convention(%5 : $@out Bendable, %99 = tuple (thin) -> ():
                                 ^
<stdin>:29:44: error: expected declaration
store %33 = alloc_ref [fragile] @convention(%5 : $@out Bendable, %99 = tuple (thin) -> ():
                                           ^
<stdin>:31:36: error: expected numeric value following '$'
%5 = function_ref @convention(%6 : $Builtin.Int1
                                   ^
<stdin>:36:34: error: unterminated string literal
store %1 = tuple () -000000000000") {
                                 ^
<stdin>:38:32: error: attribute can only be applied to types, not declarations
%8 : $*Builtin.some!enumelt: $@box Spoon
                               ^
<stdin>:38:36: error: expected declaration
%8 : $*Builtin.some!enumelt: $@box Spoon
                                   ^
<stdin>:40:1: error: extraneous '}' at top level
}
^
<stdin>:41:1: error: extraneous '}' at top level
}
^
<stdin>:42:1: error: expressions are not allowed at the top level
bb0(thin) : AssocReqt module def_basic {}
^
<stdin>:42:10: error: consecutive statements on a line must be separated by ';'
bb0(thin) : AssocReqt module def_basic {}
         ^
         ;
<stdin>:42:11: error: expected expression
bb0(thin) : AssocReqt module def_basic {}
          ^
<stdin>:42:40: error: statement cannot begin with a closure expression
bb0(thin) : AssocReqt module def_basic {}
                                       ^
<stdin>:42:40: note: explicitly discard the result of the closure by assigning to '_'
bb0(thin) : AssocReqt module def_basic {}
                                       ^
                                       _ =
<stdin>:42:40: error: expressions are not allowed at the top level
bb0(thin) : AssocReqt module def_basic {}
                                       ^
<stdin>:42:40: error: braced block of statements is an unused closure
bb0(thin) : AssocReqt module def_basic {}
                                       ^
<stdin>:43:1: error: expressions are not allowed at the top level
%12 = strong_release %5 : $*Spoon
^
<stdin>:43:21: error: consecutive statements on a line must be separated by ';'
%12 = strong_release %5 : $*Spoon
                    ^
                    ;
<stdin>:43:22: error: expressions are not allowed at the top level
%12 = strong_release %5 : $*Spoon
                     ^
<stdin>:43:24: error: consecutive statements on a line must be separated by ';'
%12 = strong_release %5 : $*Spoon
                       ^
                       ;
<stdin>:43:25: error: expected expression
%12 = strong_release %5 : $*Spoon
                        ^
<stdin>:45:17: error: unterminated string literal
sil [_semantics "foo(%2 = apply [fragile] @owned A>
                ^
<stdin>:46:19: error: attribute can only be applied to types, not declarations
%14 = alloc_box $@convention(thin) : $@owned A, bb1:
                  ^
<stdin>:46:29: error: expected declaration
%14 = alloc_box $@convention(thin) : $@owned A, bb1:
                            ^
<stdin>:46:40: error: attribute can only be applied to types, not declarations
%14 = alloc_box $@convention(thin) : $@owned A, bb1:
                                       ^
<stdin>:46:46: error: expected declaration
%14 = alloc_box $@convention(thin) : $@owned A, bb1:
                                             ^
<stdin>:47:1: error: extraneous '}' at top level
}
^
<stdin>:48:1: error: extraneous '}' at top level
}
^
<stdin>:49:8: error: expected '{' in class
class B
       ^
<stdin>:50:1: error: extraneous '}' at top level
}
^
<stdin>:51:10: error: expected type
var free:
         ^
<stdin>:52:6: error: expected numeric value following '$'
%0 : $SomeProtocol.RawPointer
     ^
<stdin>:52:1: error: expressions are not allowed at the top level
%0 : $SomeProtocol.RawPointer
^
<stdin>:52:3: error: consecutive statements on a line must be separated by ';'
%0 : $SomeProtocol.RawPointer
  ^
  ;
<stdin>:52:4: error: expected expression
%0 : $SomeProtocol.RawPointer
   ^
<stdin>:53:5: error: initializers may only be declared within a type
init(@owned Optional<C>
    ^
<stdin>:53:6: error: expected parameter name followed by ':'
init(@owned Optional<C>
     ^
<stdin>:53:6: error: expected ',' separator
init(@owned Optional<C>
     ^
     ,
<stdin>:53:6: error: expected ')' in parameter
init(@owned Optional<C>
     ^
<stdin>:53:5: note: to match this opening '('
init(@owned Optional<C>
    ^
<stdin>:53:6: error: consecutive statements on a line must be separated by ';'
init(@owned Optional<C>
     ^
     ;
<stdin>:53:7: error: attribute can only be applied to types, not declarations
init(@owned Optional<C>
      ^
<stdin>:53:13: error: expected declaration
init(@owned Optional<C>
            ^
<stdin>:54:1: error: extraneous '}' at top level
}
^
4  sil-opt         0x0000000000e07de4 swift::NominalTypeDecl::getDeclaredType() const + 4
15 sil-opt         0x0000000000ccf99d swift::ClangModuleUnit::lookupVisibleDecls(llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::VisibleDeclConsumer&, swift::NLKind) const + 317
16 sil-opt         0x0000000000e35bb6 swift::ModuleDecl::lookupVisibleDecls(llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::VisibleDeclConsumer&, swift::NLKind) const + 70
19 sil-opt         0x0000000000e4081d swift::namelookup::lookupVisibleDeclsInModule(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::pair<llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >) + 1101
20 sil-opt         0x0000000000e26ce2 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1746
21 sil-opt         0x0000000000b29962 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 290
22 sil-opt         0x0000000000ad1d09 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3929
26 sil-opt         0x0000000000da552e swift::Expr::walk(swift::ASTWalker&) + 46
27 sil-opt         0x0000000000ad2590 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>) + 224
28 sil-opt         0x0000000000ad8fc2 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610
30 sil-opt         0x0000000000b542e6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
31 sil-opt         0x0000000000b0e0ed swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133
32 sil-opt         0x0000000000772169 swift::CompilerInstance::performSema() + 3289
33 sil-opt         0x000000000075b63d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	While type-checking expression at [<stdin>:3:1 - line:3:4] RangeText="bb0("
2.	/usr/local/bin/swift/lib/swift/shims/HeapObject.h:38:8: importing 'HeapObject'
3.	/usr/local/bin/swift/lib/swift/shims/HeapObject.h:40:23: importing 'HeapObject::metadata'
```
2016-07-23 05:46:41 +02:00
practicalswift
2297b637ad [SIL] Add test case for crash triggered in swift::GenericSignature::getCanonicalSignature() const
Stack trace:

```
<stdin>:3:25: error: expected type
sil_global@d:$(<τ>()->(
<stdin>:3:25: error: expected ',' separator
sil_global@d:$(<τ>()->(
<stdin>:3:25: error: expected ',' separator
sil_global@d:$(<τ>()->(
<stdin>:3:25: error: expected type
sil_global@d:$(<τ>()->(
<stdin>:3:25: error: expected ',' separator
sil_global@d:$(<τ>()->(
4  sil-opt         0x0000000000e2b537 swift::GenericSignature::getCanonicalSignature() const + 7
7  sil-opt         0x0000000000b617b4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
8  sil-opt         0x0000000000b60750 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
9  sil-opt         0x0000000000b14911 swift::performTypeLocChecking(swift::ASTContext&, swift::TypeLoc&, bool, swift::DeclContext*, bool) + 561
11 sil-opt         0x0000000000a5c2b4 swift::Parser::parseSILGlobal() + 548
12 sil-opt         0x0000000000a982fb swift::Parser::parseTopLevel() + 731
13 sil-opt         0x0000000000a51170 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 208
14 sil-opt         0x00000000007726c6 swift::CompilerInstance::performSema() + 3254
15 sil-opt         0x000000000075bb9d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	With parser at source location: <stdin>:3:25
2.	While resolving type (() -> ()) at [<stdin>:3:15 - line:3:24] RangeText="(<τ>()->("
```
2016-07-23 05:43:03 +02:00
practicalswift
eae6a75d92 [swiftc (71 vs. 5115)] Add crasher in swift::constraints::ConstraintSystem::diagnoseFailureForExpr(...)
Add test case for crash triggered in `swift::constraints::ConstraintSystem::diagnoseFailureForExpr(...)`.

Current number of unresolved compiler crashers: 71 (5115 resolved)

Assertion failure in `llvm/include/llvm/Support/Casting.h (line 237)`:

```
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

When executing: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::AnyMetatypeType, Y = swift::TypeBase]
```

Assertion context:

```
                          typename simplify_type<Y>::SimpleType>::doit(Val);
}

template <class X, class Y>
inline typename cast_retty<X, Y *>::ret_type cast(Y *Val) {
  assert(isa<X>(Val) && "cast<Ty>() argument of incompatible type!");
  return cast_convert_val<X, Y*,
                          typename simplify_type<Y*>::SimpleType>::doit(Val);
}

// cast_or_null<X> - Functionally identical to cast, except that a null value is
```
Stack trace:

```
swift: /path/to/llvm/include/llvm/Support/Casting.h:237: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = swift::AnyMetatypeType, Y = swift::TypeBase]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
9  swift           0x0000000000f7d2fa swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 8698
10 swift           0x0000000000f8085e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 3998
11 swift           0x0000000000eb0882 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
12 swift           0x0000000000eb744d swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 621
13 swift           0x0000000000eb9154 swift::TypeChecker::typeCheckCondition(swift::Expr*&, swift::DeclContext*) + 180
14 swift           0x0000000000eb92ab swift::TypeChecker::typeCheckStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>&, swift::DeclContext*, swift::Diag<>) + 251
18 swift           0x0000000000f3182a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
19 swift           0x0000000000f3168e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
20 swift           0x0000000000f32253 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
22 swift           0x0000000000eecb01 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
23 swift           0x0000000000c73279 swift::CompilerInstance::performSema() + 3289
25 swift           0x00000000007d94b7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
26 swift           0x00000000007a54b8 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28376-swift-constraints-constraintsystem-diagnosefailureforexpr.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28376-swift-constraints-constraintsystem-diagnosefailureforexpr-9a6535.o
1.	While type-checking declaration 0x5cf0350 at validation-test/compiler_crashers/28376-swift-constraints-constraintsystem-diagnosefailureforexpr.swift:11:5
2.	While type-checking expression at [validation-test/compiler_crashers/28376-swift-constraints-constraintsystem-diagnosefailureforexpr.swift:11:9 - line:11:9] RangeText="c"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-07-23 05:40:08 +02:00
practicalswift
c3af360e2d [SourceKit] Add test case for crash triggered in swift::IterativeTypeChecker::processTypeCheckSuperclass(swift::ClassDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>)
Stack trace:

```
found code completion token A at offset 165
swift-ide-test: /path/to/swift/lib/AST/Decl.cpp:4855: void swift::ClassDecl::setSuperclass(swift::Type): Assertion `(!superclass || !superclass->hasArchetype()) && "superclass must be interface type"' failed.
9  swift-ide-test  0x0000000000a8f92d swift::IterativeTypeChecker::processTypeCheckSuperclass(swift::ClassDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 269
10 swift-ide-test  0x0000000000a72a0d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
11 swift-ide-test  0x000000000097ea90 swift::TypeChecker::resolveSuperclass(swift::ClassDecl*) + 64
12 swift-ide-test  0x0000000000c876c9 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 217
13 swift-ide-test  0x0000000000c8af52 swift::ConformanceLookupTable::lookupConformance(swift::ModuleDecl*, swift::NominalTypeDecl*, swift::ProtocolDecl*, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ProtocolConformance*>&) + 50
14 swift-ide-test  0x0000000000c5007f swift::ModuleDecl::lookupConformance(swift::Type, swift::ProtocolDecl*, swift::LazyResolver*) + 1103
15 swift-ide-test  0x00000000009cf01a swift::TypeChecker::conformsToProtocol(swift::Type, swift::ProtocolDecl*, swift::DeclContext*, swift::OptionSet<swift::ConformanceCheckFlags, unsigned int>, swift::ProtocolConformance**, swift::SourceLoc) + 106
16 swift-ide-test  0x00000000009f5b7d swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1309
20 swift-ide-test  0x00000000009f70be swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
22 swift-ide-test  0x00000000009f8014 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
23 swift-ide-test  0x00000000009f6fb0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
24 swift-ide-test  0x000000000098010a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5322
25 swift-ide-test  0x00000000009c07f5 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 389
26 swift-ide-test  0x00000000009c2107 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
27 swift-ide-test  0x00000000009c2c6f swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 111
28 swift-ide-test  0x00000000009816eb swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 363
34 swift-ide-test  0x0000000000986ee6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
35 swift-ide-test  0x00000000009ab6d2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
36 swift-ide-test  0x00000000007a6dc9 swift::CompilerInstance::performSema() + 3289
37 swift-ide-test  0x000000000074a181 main + 34609
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'A' at <INPUT-FILE>:3:1
2.	While resolving type e at [<INPUT-FILE>:8:11 - line:8:11] RangeText="e"
```
2016-07-23 05:39:46 +02:00
practicalswift
f40a9e5587 Merge pull request #3692 from practicalswift/sourcekit-077-swift-archetypebuilder-potentialarchetype-gettype
[SourceKit] Add test case for crash triggered in swift::ArchetypeBuilder::PotentialArchetype::getType(…)
2016-07-23 05:37:39 +02:00
practicalswift
681c6ac059 Merge pull request #3693 from practicalswift/swiftc-28375-swift-typechecker-lookupmembertype
[swiftc (71 vs. 5114)] Add crasher in swift::TypeChecker::lookupMemberType(...)
2016-07-23 05:37:24 +02:00
Nate Cook
c9c865c279 [stdlib] Update partition(by:) tests
Adds a dispatch test for partition(by:), since it's now a protocol
requirement. Also adds a new logging collection wrapper that only
logs when _withUnsafeMutableBufferPointerIfSupported is called --
any calls to this method from dispatched methods are uncounted by
the standard logging wrappers.
2016-07-22 22:31:27 -05:00
Jordan Rose
c98a855dbb Rework access checking in terms of "access scopes", and default to 'internal'
Merge pull request #3506 from jrose-apple/private-and-fileprivate

More progress on SE-0025.
2016-07-22 17:27:52 -07:00
practicalswift
a3c2f8be5b [swiftc (71 vs. 5114)] Add crasher in swift::TypeChecker::lookupMemberType(...)
Add test case for crash triggered in `swift::TypeChecker::lookupMemberType(...)`.

Current number of unresolved compiler crashers: 71 (5114 resolved)

Assertion failure in [`lib/Sema/TypeCheckNameLookup.cpp (line 328)`](https://github.com/apple/swift/blob/master/lib/Sema/TypeCheckNameLookup.cpp#L328):

```
Assertion `!type->isTypeParameter()' failed.

When executing: swift::LookupTypeResult swift::TypeChecker::lookupMemberType(swift::DeclContext *, swift::Type, swift::Identifier, NameLookupOptions)
```

Assertion context:

```
  // Look through the metatype.
  if (auto metaT = type->getAs<AnyMetatypeType>())
    type = metaT->getInstanceType();

  // Callers must cope with dependent types directly.
  assert(!type->isTypeParameter());

  // Look for members with the given name.
  SmallVector<ValueDecl *, 4> decls;
  NLOptions subOptions = NL_QualifiedDefault | NL_OnlyTypes;

```
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckNameLookup.cpp:328: swift::LookupTypeResult swift::TypeChecker::lookupMemberType(swift::DeclContext *, swift::Type, swift::Identifier, NameLookupOptions): Assertion `!type->isTypeParameter()' failed.
8  swift           0x0000000000f06e74 swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1572
10 swift           0x0000000000f3800e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
12 swift           0x0000000000f38f64 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
13 swift           0x0000000000f37f00 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
15 swift           0x0000000000f01b9e swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94
18 swift           0x0000000000ec41c3 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 947
23 swift           0x00000000011057b5 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1189
24 swift           0x0000000000f07102 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 290
25 swift           0x0000000000eafee9 swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 3865
27 swift           0x000000000108188b swift::Expr::walk(swift::ASTWalker&) + 27
28 swift           0x0000000000eb0770 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>) + 224
29 swift           0x0000000000eb75ad swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 621
30 swift           0x0000000000eb8760 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 352
31 swift           0x0000000000eb897b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
35 swift           0x0000000000ec95b6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
38 swift           0x0000000000f31f44 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
39 swift           0x0000000000f5da0c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
40 swift           0x0000000000eb764a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 778
42 swift           0x0000000000f32086 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
43 swift           0x0000000000eebe4d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133
44 swift           0x0000000000c735c9 swift::CompilerInstance::performSema() + 3289
46 swift           0x00000000007d9277 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
47 swift           0x00000000007a5278 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28375-swift-typechecker-lookupmembertype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28375-swift-typechecker-lookupmembertype-f72c36.o
1.	While type-checking expression at [validation-test/compiler_crashers/28375-swift-typechecker-lookupmembertype.swift:10:1 - line:11:15] RangeText="{struct S<T{var:e=d func g:e.a
2.	While type-checking 'S' at validation-test/compiler_crashers/28375-swift-typechecker-lookupmembertype.swift:10:2
3.	While type-checking expression at [validation-test/compiler_crashers/28375-swift-typechecker-lookupmembertype.swift:10:19 - line:10:19] RangeText="d"
4.	While type-checking 'g' at validation-test/compiler_crashers/28375-swift-typechecker-lookupmembertype.swift:10:21
5.	While resolving type e.a at [validation-test/compiler_crashers/28375-swift-typechecker-lookupmembertype.swift:10:28 - line:10:30] RangeText="e.a"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-07-23 00:27:25 +02:00