Commit Graph

1442 Commits

Author SHA1 Message Date
Dmitri Gribenko
677a235876 Merge pull request #1065 from practicalswift/swiftc-28231-swift-constraints-constraintsystem-solvesimplified
[swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::solveSimplified(…)
2016-01-23 21:21:23 -08:00
Ted Kremenek
5699bc67d4 Merge pull request #1003 from practicalswift/adhere-to-subset-of-pep8-iii
[gardening] Fix violations of non-controversial PEP8 rules
2016-01-23 16:38:43 -08:00
practicalswift
d93b984783 [swiftc] Add test case for crash triggered in swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding)
Stack trace:

```
4  swift           0x0000000000ed21a1 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 11201
5  swift           0x0000000000ecdcc5 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 325
6  swift           0x0000000000ecda79 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 73
7  swift           0x0000000000de2d96 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>) + 614
8  swift           0x0000000000de9159 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
11 swift           0x0000000000e49d05 swift::TypeChecker::typeCheckDestructorBodyUntil(swift::DestructorDecl*, swift::SourceLoc) + 181
12 swift           0x0000000000e4926b swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 27
13 swift           0x0000000000e49e48 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
15 swift           0x0000000000dd04e2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1746
16 swift           0x0000000000c7b9cf swift::CompilerInstance::performSema() + 2975
18 swift           0x0000000000775277 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
19 swift           0x000000000076fe55 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28231-swift-constraints-constraintsystem-solvesimplified.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28231-swift-constraints-constraintsystem-solvesimplified-577440.o
1.	While type-checking 'deinit' at validation-test/compiler_crashers/28231-swift-constraints-constraintsystem-solvesimplified.swift:7:19
2.	While type-checking expression at [validation-test/compiler_crashers/28231-swift-constraints-constraintsystem-solvesimplified.swift:7:26 - line:7:29] RangeText="a(a{"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-23 10:32:00 +01:00
Dmitri Gribenko
2ad7d97e41 Merge pull request #1064 from practicalswift/add-swift-marker
[gardening] Add "-*- swift -*-" to *.swift.gyb. Remove from *.swift.
2016-01-23 01:29:46 -08:00
practicalswift
ca9e488f30 [gardening] Add "-*- swift -*-" to *.swift.gyb. Remove from *.swift. 2016-01-23 10:27:03 +01:00
practicalswift
1cd4d4e9c9 [gardening] Fix violations of non-controversial PEP8 rules
Fixes:
* multiple statements on one line (colon) (E701)
* missing whitespace around arithmetic operator (E226)
* missing whitespace around operator (E225)
* closing bracket does not match visual indentation (E124)
* blank line contains whitespace (W293)
* continuation line missing indentation or outdented (E122)
* continuation line over-indented for hanging indent (E126)
* missing expected blank line (E301)
* trailing whitespace (W291)
* unexpected spaces around keyword / parameter equals (E251)
* whitespace after '(', '[' or '{' (E201)
* whitespace before ')', ']' or '}' (E202)
* whitespace before ',' or ':' (E203)
2016-01-23 09:23:33 +01:00
practicalswift
e4a66eeb2c [swiftc] Add test case for crash triggered in swift::ValueDecl::getInterfaceType() const
Stack trace:

```
swift: /path/to/swift/include/swift/AST/Decl.h:2191: swift::Type swift::ValueDecl::getType() const: Assertion `hasType() && "declaration has no type set yet"' failed.
8  swift           0x0000000000fbb008 swift::ValueDecl::getInterfaceType() const + 472
9  swift           0x0000000000fbb886 swift::TypeDecl::getDeclaredInterfaceType() const + 6
10 swift           0x0000000000e4e857 swift::TypeChecker::substMemberTypeWithBase(swift::ModuleDecl*, swift::ValueDecl const*, swift::Type, bool) + 55
12 swift           0x0000000000e4f05e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
14 swift           0x0000000000e4ffc4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
15 swift           0x0000000000e4ef6a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
20 swift           0x0000000000e04076 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
21 swift           0x0000000000dd03e2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1490
22 swift           0x0000000000c7b9cf swift::CompilerInstance::performSema() + 2975
24 swift           0x0000000000775277 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
25 swift           0x000000000076fe55 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28229-swift-valuedecl-getinterfacetype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28229-swift-valuedecl-getinterfacetype-9ca3a6.o
1.	While type-checking 'c' at validation-test/compiler_crashers/28229-swift-valuedecl-getinterfacetype.swift:8:1
2.	While resolving type e.a at [validation-test/compiler_crashers/28229-swift-valuedecl-getinterfacetype.swift:8:56 - line:8:58] RangeText="e.c"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-23 08:36:06 +01:00
Dmitri Gribenko
9bcd5a1056 Collection.length => .count 2016-01-22 18:41:19 -08:00
Dmitri Gribenko
5e1579dac4 Merge pull request #1056 from practicalswift/swiftc-28228-swift-dependentgenerictyperesolver-resolveselfassociatedtype
[swiftc] Add test case for crash triggered in swift::DependentGenericTypeResolver::resolveSelfAssociatedType(…)
2016-01-22 17:25:55 -08:00
Slava Pestov
59a2e2aff8 Library evolution tests: add test for changing body of a transparent function
I'm going to add some more tests related to @_transparent shortly,
and it is important to verify that bodies of @_transparent functions
are serialized (at least in single-frontend mode, for now).

I realize this test is probably too specific, since in the future
we may sometimes choose not to inline @_transparent functions into
their callers, even if a serialized body is available; but this
will suffice for now.
2016-01-22 16:44:33 -08:00
Slava Pestov
14c9329920 Library evolution tests: preliminary tests for resiliently-sized classes
Note that subclassing of resilient classes doesn't work yet, and
there are no tests for it.
2016-01-22 16:04:38 -08:00
Slava Pestov
c5592e63ff Library evolution tests: split up struct_add_remove_properties into multiple tests 2016-01-22 16:04:29 -08:00
practicalswift
83ce5b956b [swiftc] Add test case for crash triggered in swift::DependentGenericTypeResolver::resolveSelfAssociatedType(swift::Type, swift::DeclContext*, swift::AssociatedTypeDecl*)
Stack trace:

```
swift: /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  swift           0x0000000000e228a0 swift::DependentGenericTypeResolver::resolveSelfAssociatedType(swift::Type, swift::DeclContext*, swift::AssociatedTypeDecl*) + 0
10 swift           0x0000000000e5076e 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           0x0000000000e516d4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
13 swift           0x0000000000e5067a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
14 swift           0x0000000000e2326c swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 748
15 swift           0x0000000000e2493f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
16 swift           0x0000000000e24cf4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
17 swift           0x0000000000e00042 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 354
18 swift           0x0000000000ff9a1c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
19 swift           0x0000000000ff83c0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
20 swift           0x0000000000e26e4b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
23 swift           0x0000000000e5076e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
25 swift           0x0000000000e516d4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
26 swift           0x0000000000e5067a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
27 swift           0x0000000000edc802 swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 146
28 swift           0x0000000000edba8d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
29 swift           0x0000000000dfcd49 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137
30 swift           0x0000000000e002f1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1041
32 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
33 swift           0x0000000000dd1b12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
34 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
36 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
37 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28228-swift-dependentgenerictyperesolver-resolveselfassociatedtype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28228-swift-dependentgenerictyperesolver-resolveselfassociatedtype-a5a67f.o
1.	While type-checking 'c' at validation-test/compiler_crashers/28228-swift-dependentgenerictyperesolver-resolveselfassociatedtype.swift:9:1
2.	While resolving type d at [validation-test/compiler_crashers/28228-swift-dependentgenerictyperesolver-resolveselfassociatedtype.swift:9:34 - line:9:34] RangeText="d"
3.	While resolving type e.T at [validation-test/compiler_crashers/28228-swift-dependentgenerictyperesolver-resolveselfassociatedtype.swift:10:19 - line:10:21] RangeText="e.T"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 23:31:25 +01:00
practicalswift
ebf38bdfc2 [swiftc] Add test case for crash triggered in swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool)
Stack trace:

```
swift: /path/to/swift/include/swift/AST/Decl.h:2191: swift::Type swift::ValueDecl::getType() const: Assertion `hasType() && "declaration has no type set yet"' failed.
8  swift           0x0000000000df720d swift::TypeChecker::getTypeOfRValue(swift::ValueDecl*, bool) + 221
9  swift           0x0000000000e6114d swift::createImplicitConstructor(swift::TypeChecker&, swift::NominalTypeDecl*, swift::ImplicitConstructorKind) + 525
10 swift           0x0000000000e0abac swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1404
11 swift           0x0000000000ff998b swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2763
13 swift           0x0000000000e27892 swift::TypeChecker::lookupMember(swift::DeclContext*, swift::Type, swift::DeclName, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 386
14 swift           0x0000000000e28189 swift::TypeChecker::lookupConstructors(swift::DeclContext*, swift::Type, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 41
15 swift           0x0000000000ec1abf swift::constraints::ConstraintSystem::simplifyConstructionConstraint(swift::Type, swift::FunctionType*, unsigned int, swift::constraints::ConstraintLocator*) + 207
16 swift           0x0000000000ec670f swift::constraints::ConstraintSystem::simplifyApplicableFnConstraint(swift::constraints::Constraint const&) + 943
17 swift           0x0000000000ec6f60 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 880
18 swift           0x0000000000e69fd7 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
21 swift           0x0000000000f63515 swift::Expr::walk(swift::ASTWalker&) + 69
22 swift           0x0000000000ea75d8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
23 swift           0x0000000000de42c0 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>) + 256
24 swift           0x0000000000dea7e9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
25 swift           0x0000000000deb960 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
26 swift           0x0000000000debb09 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
28 swift           0x0000000000e00d7c swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3740
29 swift           0x0000000000ff9a1c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
30 swift           0x0000000000ff83c0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
31 swift           0x0000000000e26e4b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
34 swift           0x0000000000e5076e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
36 swift           0x0000000000e516d4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
37 swift           0x0000000000e5067a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
38 swift           0x0000000000dfe0aa swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4890
39 swift           0x0000000000e00605 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1829
44 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
45 swift           0x0000000000dd1b12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
46 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
48 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
49 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28227-swift-typechecker-gettypeofrvalue.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28227-swift-typechecker-gettypeofrvalue-c6b32f.o
1.	While type-checking 'c' at validation-test/compiler_crashers/28227-swift-typechecker-gettypeofrvalue.swift:8:1
2.	While resolving type a at [validation-test/compiler_crashers/28227-swift-typechecker-gettypeofrvalue.swift:8:19 - line:8:19] RangeText="a"
3.	While type-checking expression at [validation-test/compiler_crashers/28227-swift-typechecker-gettypeofrvalue.swift:8:33 - line:8:35] RangeText="A{}"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 23:18:30 +01:00
practicalswift
83d902a881 [swiftc] Add test case for crash triggered in swift::IterativeTypeChecker::processInheritedProtocols(swift::ProtocolDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>)
Stack trace:

```
swift: /path/to/swift/include/swift/AST/Decl.h:3495: void swift::ProtocolDecl::setInheritedProtocols(ArrayRef<swift::ProtocolDecl *>): Assertion `!InheritedProtocolsSet && "protocols already set"' failed.
8  swift           0x0000000000edd252 swift::IterativeTypeChecker::processInheritedProtocols(swift::ProtocolDecl*, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 1602
9  swift           0x0000000000edba8d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
10 swift           0x0000000000dfcca0 swift::TypeChecker::resolveInheritedProtocols(swift::ProtocolDecl*) + 64
11 swift           0x0000000000ef98e1 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 225
14 swift           0x0000000000efb47f swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
15 swift           0x0000000000ef964b swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 603
16 swift           0x0000000000ef9a07 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 519
19 swift           0x0000000000efb47f swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
20 swift           0x0000000000ef964b swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 603
21 swift           0x0000000000ef93cc swift::ArchetypeBuilder::addGenericParameterRequirements(swift::GenericTypeParamDecl*) + 172
22 swift           0x0000000000e23107 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 391
23 swift           0x0000000000e2493f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
24 swift           0x0000000000e24cf4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
25 swift           0x0000000000e003c0 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1248
28 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
29 swift           0x0000000000dd1b12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
30 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
32 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
33 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28226-swift-iterativetypechecker-processinheritedprotocols.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28226-swift-iterativetypechecker-processinheritedprotocols-2a895f.o
1.	While type-checking 'A' at validation-test/compiler_crashers/28226-swift-iterativetypechecker-processinheritedprotocols.swift:8:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 22:22:27 +01:00
Dmitri Gribenko
f7b5536600 Merge pull request #1046 from practicalswift/swiftc-28225-swift-typechecker-checkconformance
[swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(…)
2016-01-22 13:06:34 -08:00
Joe Pamer
a59e78749d - When simplifying constraint systems generated for deeply nested binary expressions with homogeneous argument types, directly bind the parameter type variable to the argument type. This generally improves type check performance of such expressions.
- Fix the test invocation of a fixed compiler crasher - it now compiles and runs cleanly.
2016-01-22 12:34:34 -08:00
Joe Pamer
e9c44f2877 Resolve three crashers that were fixed by the last set of changes. 2016-01-22 12:34:34 -08:00
practicalswift
351851b64f [swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*)
Stack trace:

```
6  swift           0x0000000000e2f88d swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 1293
10 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
13 swift           0x0000000000e4ab3a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
14 swift           0x0000000000e4a98e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
15 swift           0x0000000000e4b558 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
17 swift           0x0000000000dd1c12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
18 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
20 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
21 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28225-swift-typechecker-checkconformance.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28225-swift-typechecker-checkconformance-39d6d8.o
1.	While type-checking 'e' at validation-test/compiler_crashers/28225-swift-typechecker-checkconformance.swift:7:1
2.	While type-checking 'k' at validation-test/compiler_crashers/28225-swift-typechecker-checkconformance.swift:7:8
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 15:59:56 +01:00
practicalswift
06154e1476 [swiftc] Add test case for crash triggered in swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&)
Stack trace:

```
swift: /path/to/swift/lib/AST/ASTContext.cpp:2918: static swift::GenericFunctionType *swift::GenericFunctionType::get(swift::GenericSignature *, swift::Type, swift::Type, const swift::AnyFunctionType::ExtInfo &): Assertion `sig && "no generic signature for generic function type?!"' failed.
8  swift           0x0000000000f134de swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&) + 574
10 swift           0x0000000000e001ec swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 780
11 swift           0x0000000000ff9a1c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
12 swift           0x0000000000e27bca swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 282
14 swift           0x0000000000e5076e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
16 swift           0x0000000000e516d4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000e5067a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000e23242 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 706
19 swift           0x0000000000e2493f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
20 swift           0x0000000000e24cf4 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
21 swift           0x0000000000e00042 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 354
24 swift           0x0000000000e05766 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
27 swift           0x0000000000e4be6a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
28 swift           0x0000000000e758fc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
29 swift           0x0000000000dea85b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
31 swift           0x0000000000e4bfb6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
32 swift           0x0000000000dd1b7d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
33 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
35 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
36 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28224-swift-genericfunctiontype-get-d82d73.o
1.	While type-checking expression at [validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:1 - line:8:28] RangeText="{enum S<T where S.c:A{case c"
2.	While type-checking 'S' at validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:2
3.	While resolving type S.c at [validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:17 - line:8:19] RangeText="S.c"
4.	While type-checking 'c' at validation-test/compiler_crashers/28224-swift-genericfunctiontype-get.swift:8:28
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 11:29:14 +01:00
practicalswift
d062340887 [swiftc] Add test case for crash triggered in swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const
Stack trace:

```
5  swift           0x00000000010122bc swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 44
6  swift           0x0000000001012543 swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 691
7  swift           0x0000000000e6b8dd swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext*, llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Requirement>, bool, unsigned int, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 1293
9  swift           0x00000000010122bc swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 44
10 swift           0x0000000000e6c23a swift::constraints::ConstraintSystem::getTypeOfMemberReference(swift::Type, swift::ValueDecl*, bool, bool, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >*) + 778
11 swift           0x0000000000e6d537 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 519
12 swift           0x0000000000ec6f93 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 931
13 swift           0x0000000000e69fd7 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
14 swift           0x0000000000e6d2c7 swift::constraints::ConstraintSystem::addOverloadSet(swift::Type, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocator*, swift::constraints::OverloadChoice*) + 327
15 swift           0x0000000000ec5448 swift::constraints::ConstraintSystem::simplifyMemberConstraint(swift::constraints::Constraint const&) + 600
16 swift           0x0000000000ec6c34 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 68
17 swift           0x0000000000e69fd7 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
20 swift           0x0000000000f63515 swift::Expr::walk(swift::ASTWalker&) + 69
21 swift           0x0000000000ea75d8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
22 swift           0x0000000000de42c0 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>) + 256
23 swift           0x0000000000dea7e9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
26 swift           0x0000000000e4ab3a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
27 swift           0x0000000000e4a98e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
28 swift           0x0000000000e4b558 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
30 swift           0x0000000000dd1c12 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
31 swift           0x0000000000c7d14f swift::CompilerInstance::performSema() + 2975
33 swift           0x00000000007751c7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
34 swift           0x000000000076fda5 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28223-swift-type-transform.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28223-swift-type-transform-1612ec.o
1.	While type-checking 'b' at validation-test/compiler_crashers/28223-swift-type-transform.swift:7:28
2.	While type-checking expression at [validation-test/compiler_crashers/28223-swift-type-transform.swift:7:35 - line:7:35] RangeText="b"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-22 10:56:36 +01:00
practicalswift
ed90deabb5 [swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*)
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 || firstArchetype->getIsRecursive() || isOpenedAnyObject(replacement) || replacement->is<GenericTypeParamType>()) && "Constraint system missed a conformance?"' failed.
13 swift           0x0000000000e2f7f3 swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 2083
19 swift           0x0000000000e053b6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
22 swift           0x0000000000e4baba swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
23 swift           0x0000000000e7557c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
24 swift           0x0000000000dea4ab swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
25 swift           0x0000000000deb5b0 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
26 swift           0x0000000000deb759 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
31 swift           0x0000000000e053b6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
34 swift           0x0000000000e4a78a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
35 swift           0x0000000000e4a5de swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
36 swift           0x0000000000e4b1a8 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
38 swift           0x0000000000dd1862 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
39 swift           0x0000000000c7d15f swift::CompilerInstance::performSema() + 2975
41 swift           0x0000000000775137 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
42 swift           0x000000000076fd15 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28222-swift-typechecker-checkconformance-e1d9f6.o
1.	While type-checking declaration 0x47c2e80 at validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:6
2.	While type-checking 'B' at validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:7
3.	While type-checking expression at [validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:39 - line:8:58] RangeText="{struct B<a{enum B{c"
4.	While type-checking 'B' at validation-test/compiler_crashers/28222-swift-typechecker-checkconformance.swift:8:40
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-21 22:48:53 +01:00
Slava Pestov
b6b5f8bfa9 Add preliminary enum evolution tests
These are passing now that resilient enum case numbering has been
implemented.
2016-01-21 12:10:58 -08:00
Dmitri Gribenko
62f73f4469 Rename CollectionDefaultIterator to IndexingIterator 2016-01-21 11:49:03 -08:00
Erik Eckstein
adef0368bb tests: add import statements to workaround linker errors in all relevant tests.
This is needed if we compile StdlibUnittest with -sil-serialize-all
So far I added the imports only in files which needed them. But this may change, depending on the optimizer (inlining).
Adding them in all files doesn't harm and avoids confusion if someone makes an unrelated change which would result in such a linker error.
2016-01-21 09:59:50 -08:00
practicalswift
10ffde9f5f [swiftc] Add test case for crash triggered in swift::TypeBase::getMemberSubstitutions(swift::DeclContext*)
Stack trace:

```
swift: /path/to/swift/lib/AST/Type.cpp:2465: TypeSubstitutionMap swift::TypeBase::getMemberSubstitutions(swift::DeclContext *): Assertion `baseTy && "Couldn't find appropriate context"' failed.
8  swift           0x000000000103021a swift::TypeBase::getMemberSubstitutions(swift::DeclContext*) + 458
9  swift           0x000000000103051a swift::TypeBase::getTypeOfMember(swift::ModuleDecl*, swift::Type, swift::DeclContext*) + 58
10 swift           0x0000000000e85547 swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 1591
14 swift           0x0000000000e85f5e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
16 swift           0x0000000000e86ec4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000e85e6a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000e33a6a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4890
19 swift           0x0000000000e35fc5 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1829
20 swift           0x0000000001015e7c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
21 swift           0x0000000000e5d2aa swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 282
23 swift           0x0000000000e85f5e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
25 swift           0x0000000000e86ec4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
26 swift           0x0000000000e85e6a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
27 swift           0x0000000000e33a6a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4890
28 swift           0x0000000000e58885 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 373
29 swift           0x0000000000e5a0cf swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
30 swift           0x0000000000e5a484 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
31 swift           0x0000000000e35a02 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 354
34 swift           0x0000000000e3b126 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
37 swift           0x0000000000e8165a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
38 swift           0x0000000000eaafcc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
39 swift           0x0000000000e2024b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
41 swift           0x0000000000e817a6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
42 swift           0x0000000000e0760d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
43 swift           0x0000000000cb1f5f swift::CompilerInstance::performSema() + 2975
45 swift           0x0000000000775447 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
46 swift           0x0000000000770025 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28221-swift-typebase-getmembersubstitutions-17ebef.o
1.	While type-checking expression at [validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:1 - line:8:35] RangeText="{struct d<h:d.d{struct d struct d:d"
2.	While type-checking 'd' at validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:2
3.	While resolving type d.d at [validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:13 - line:8:15] RangeText="d.d"
4.	While resolving type d at [validation-test/compiler_crashers/28221-swift-typebase-getmembersubstitutions.swift:8:35 - line:8:35] RangeText="d"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-21 09:08:42 +01:00
Chris Willmore
983a674e0c Make use of curried function declaration syntax an error.
<rdar://problem/23111018>
2016-01-20 21:57:38 -08:00
Slava Pestov
0159627322 As promised, split up struct_add_remove_conformances library evolution test
We now test four setups, with the four {before, after}^2 runs of each:

a) Client adds conformance -vs- library adds public conformance -- fixed-layout struct
b) Client adds conformance -vs- library removes internal conformance -- fixed-layout struct
c) Client adds conformance -vs- library adds public conformance -- resilient struct
d) Client adds conformance -vs- library removes internal conformance -- resilient struct

The first two pass, but a) requires a hack to ensure we don't
directly reference conformance table, otherwise the 'after_before'
version doesn't link. I think the right idea here is to weakly
reference conformance tables where the deployment target is
lower than the availability of the conformance.

The second two are XFAIL'd until protocol conformance tables can
reference resilient types from other modules. This requires emitting
indirect metadata symbols, since the client doesn't know if the
resilient type's metadata is direct or a template, and the
conformance table cannot use the metadata accessor either.

These tests will also become important if we decide to revisit
synthesized accessors, and make them lazy again for structs.
2016-01-20 19:08:13 -08:00
Slava Pestov
1d77d810fd Re-apply "Sema: Always synthesize accessors for structs, unless they were imported from Clang"
This reverts commit 24a70e17ea.
2016-01-20 15:04:10 -08:00
Slava Pestov
f099da66b8 Add dummy Optional declaration to MicroStdlib.swift test
This broke when we switched on materializeForSet emission for all
stored properties of structs.
2016-01-20 14:51:44 -08:00
Dmitri Gribenko
220bac09a7 Remove 'asserts' requirements from fixed compiler crash tests 2016-01-20 14:40:36 -08:00
Max Moiseev
9a018bd77d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-20 14:38:22 -08:00
Chris Lattner
888c415f06 Two compiler_crashers were fixed by recent changes, update them. 2016-01-20 11:04:54 -08:00
Chris Lattner
179abf3934 Merge pull request #1023 from practicalswift/swiftc-28220-swift-lvaluetype-get
[swiftc] Add test case for crash triggered in swift::LValueType::get(…)
2016-01-20 09:20:07 -08:00
Chris Lattner
0632a65736 Merge pull request #1024 from glessard/details1
silence some warnings in validation-test/stdlib/String.swift
2016-01-20 09:19:41 -08:00
Mark Lacey
24a70e17ea Revert "Sema: Always synthesize accessors for structs, unless they were imported from Clang"
This reverts commit 2b6ab633fc because it
at least breaks:
    Swift :: stdlib/SequenceType.swift.gyb
and possibly also results in some or all of these failures:
    Swift :: compiler_crashers/27944-swift-astvisitor.swift
    Swift :: compiler_crashers/28200-swift-typebase-getdesugaredtype.swift
    Swift :: stdlib/CollectionType.swift.gyb
    Swift :: stdlib/MicroStdlib.swift
2016-01-20 08:32:39 -08:00
Guillaume Lessard
d6571c645b Replace ++ by "+= 1" 2016-01-20 07:45:54 -07:00
Guillaume Lessard
0f46bd465d Unmutated vars changed to lets 2016-01-20 07:45:54 -07:00
practicalswift
cc13df11c4 [swiftc] Add test case for crash triggered in swift::LValueType::get(swift::Type)
Stack trace:

```
swift: /path/to/swift/lib/AST/ASTContext.cpp:3216: static swift::LValueType *swift::LValueType::get(swift::Type): Assertion `!objectTy->is<ErrorType>() && "cannot have ErrorType wrapped inside LValueType"' failed.
8  swift           0x0000000000f4b6df swift::LValueType::get(swift::Type) + 639
9  swift           0x000000000102fb4b swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 3899
10 swift           0x0000000000e9ea6c swift::constraints::ConstraintSystem::getTypeOfReference(swift::ValueDecl*, bool, bool, swift::constraints::ConstraintLocatorBuilder, swift::DeclRefExpr const*) + 1820
11 swift           0x0000000000ea0ea1 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 689
12 swift           0x0000000000efd081 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 897
13 swift           0x0000000000e9d927 swift::constraints::ConstraintSystem::addConstraint(swift::constraints::Constraint*, bool, bool) + 23
14 swift           0x0000000000ea0b87 swift::constraints::ConstraintSystem::addOverloadSet(swift::Type, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocator*, swift::constraints::OverloadChoice*) + 327
18 swift           0x0000000000f7fc1e swift::Expr::walk(swift::ASTWalker&) + 46
19 swift           0x0000000000edcfd8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
20 swift           0x0000000000e17e10 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>) + 256
21 swift           0x0000000000e1e339 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
23 swift           0x0000000000e7f8e6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
24 swift           0x0000000000e0576d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
25 swift           0x0000000000cafccf swift::CompilerInstance::performSema() + 2975
27 swift           0x0000000000775367 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
28 swift           0x000000000076ff45 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28220-swift-lvaluetype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28220-swift-lvaluetype-get-a71661.o
1.	While type-checking expression at [validation-test/compiler_crashers/28220-swift-lvaluetype-get.swift:8:23 - line:8:24] RangeText="{d"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-20 13:13:28 +01:00
Slava Pestov
2b6ab633fc Sema: Always synthesize accessors for structs, unless they were imported from Clang
This fixes the issue that "SILGen: Correctly emit accessors synthesized to
witness protocol requirements" was meant to solve, but in a simpler way.

A better fix would be to first address the issue where @_transparent
function bodies are not serialized in some cases, and then only emit
synthesized accessors as needed, in the original version of this patch.
To fix the duplicate symbol issues, we would emit the synthesized
accessors with shared linkage, which would always work once serialized
bodies were available.

For resilient structs of course, we'll always need to emit accessors
anyway.
2016-01-20 02:11:53 -08:00
Slava Pestov
5d1da8b957 Fix for struct_add_remove_conformances accessing witness table directly
The test removes a public conformance, which is technically not resilient.
I will split up the test into two tests soon:

- client library adds conformance, library adds public conformance
- client library adds conformance, library removes *private* conformance
2016-01-20 01:50:17 -08:00
practicalswift
1614c8309e [swiftc] Add test case for crash triggered in swift::LValueType::get(swift::Type)
Stack trace:

```
swift: /path/to/swift/lib/AST/ASTContext.cpp:3218: static swift::LValueType *swift::LValueType::get(swift::Type): Assertion `!objectTy->is<LValueType>() && !objectTy->is<InOutType>() && "cannot have 'inout' or @lvalue wrapped inside an @lvalue"' failed.
8  swift           0x0000000000f4b682 swift::LValueType::get(swift::Type) + 546
9  swift           0x000000000102fb4b swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 3899
10 swift           0x0000000000ea1f3d swift::constraints::ConstraintSystem::simplifyType(swift::Type, llvm::SmallPtrSet<swift::TypeVariableType*, 16u>&) + 77
11 swift           0x0000000000eff165 swift::constraints::ConstraintSystem::finalize(swift::FreeTypeVariableBinding) + 2037
12 swift           0x0000000000f03fc6 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 374
13 swift           0x0000000000f071b9 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 6425
14 swift           0x0000000000f03f89 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 313
15 swift           0x0000000000f065bc swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3356
16 swift           0x0000000000f03f89 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 313
17 swift           0x0000000000f03d49 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 73
18 swift           0x0000000000e17f76 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>) + 614
19 swift           0x0000000000e1e339 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
24 swift           0x0000000000ec495a swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 106
25 swift           0x0000000000ec980e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
26 swift           0x0000000000e17fa5 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>) + 661
27 swift           0x0000000000e1e339 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
29 swift           0x0000000000e7f8e6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
30 swift           0x0000000000e0576d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
31 swift           0x0000000000cafccf swift::CompilerInstance::performSema() + 2975
33 swift           0x0000000000775367 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
34 swift           0x000000000076ff45 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28219-swift-lvaluetype-get.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28219-swift-lvaluetype-get-50f344.o
1.	While type-checking expression at [validation-test/compiler_crashers/28219-swift-lvaluetype-get.swift:8:10 - line:9:1] RangeText="println(c
2.	While type-checking expression at [validation-test/compiler_crashers/28219-swift-lvaluetype-get.swift:9:1 - line:9:1] RangeText="_"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-20 10:10:11 +01:00
practicalswift
893a70eb25 [swiftc] Add test case for crash triggered in swift::ValueDecl::setType(swift::Type)
Stack trace:

```
swift: /path/to/swift/lib/AST/Decl.cpp:1753: void swift::ValueDecl::setType(swift::Type): Assertion `!hasType() && "changing type of declaration"' failed.
8  swift           0x0000000000fd680c swift::ValueDecl::setType(swift::Type) + 92
9  swift           0x0000000000fdfbf5 swift::EnumElementDecl::computeType() + 277
13 swift           0x0000000000e39286 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
16 swift           0x0000000000e7f79a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
17 swift           0x0000000000ea987c swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
18 swift           0x0000000000e1e3ab swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
21 swift           0x0000000000e7e4ba swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
22 swift           0x0000000000e7e30e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
23 swift           0x0000000000e7eed8 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
25 swift           0x0000000000e05802 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
26 swift           0x0000000000cafccf swift::CompilerInstance::performSema() + 2975
28 swift           0x0000000000775367 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
29 swift           0x000000000076ff45 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28218-swift-valuedecl-settype-de68ab.o
1.	While type-checking getter for a at validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift:8:6
2.	While type-checking expression at [validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift:8:7 - line:8:37] RangeText="{enum a{case c(c(class c]func c"
3.	While type-checking 'a' at validation-test/compiler_crashers/28218-swift-valuedecl-settype.swift:8:8
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-20 08:49:09 +01:00
Doug Gregor
7d70b704e4 Merge commit '5e11e3f7287427d386636a169c4065c0373931a8' into swift-3-api-guidelines 2016-01-19 23:18:20 -08:00
Dmitri Gribenko
a6352968a6 Mark a crash test as fixed 2016-01-19 20:22:10 -07:00
Dmitri Gribenko
c735c00aea Merge pull request #1013 from practicalswift/swiftc-28217-swift-diagnosticengine-emitdiagnostic
[swiftc] Add test case for crash triggered in swift::DiagnosticEngine::emitDiagnostic(…)
2016-01-19 14:42:43 -08:00
Dmitri Gribenko
2874743528 Annotate a crash test as crashing in the verifier 2016-01-19 13:37:22 -07:00
practicalswift
1fbef1f777 [swiftc] Add test case for crash triggered in swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&)
Stack trace:

```
swift: /path/to/swift/lib/AST/DiagnosticEngine.cpp:463: void formatDiagnosticText(llvm::StringRef, ArrayRef<swift::DiagnosticArgument>, llvm::raw_ostream &): Assertion `ArgIndex < Args.size() && "Out-of-range argument index"' failed.
9  swift           0x0000000000fe725b swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 2891
10 swift           0x0000000000fe64ef swift::DiagnosticEngine::flushActiveDiagnostic() + 319
11 swift           0x0000000000ec5b20 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 336
12 swift           0x0000000000eca8ee swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
13 swift           0x0000000000e19225 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>) + 661
14 swift           0x0000000000e1f5b9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
18 swift           0x0000000000e3a366 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
21 swift           0x0000000000e7f59a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 362
22 swift           0x0000000000e7f3ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
23 swift           0x0000000000e7ffb8 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
25 swift           0x0000000000e06a92 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1730
26 swift           0x0000000000cb0f4f swift::CompilerInstance::performSema() + 2975
28 swift           0x0000000000775357 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
29 swift           0x000000000076ff35 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28217-swift-diagnosticengine-emitdiagnostic-78c825.o
1.	While type-checking getter for b at validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift:8:6
2.	While type-checking 'b' at validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift:8:7
3.	While type-checking expression at [validation-test/compiler_crashers/28217-swift-diagnosticengine-emitdiagnostic.swift:8:26 - line:8:26] RangeText="n"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-19 19:57:52 +01:00
practicalswift
fa7d206c85 [swiftc] Add test case for crash triggered in swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool)
Stack trace:

```
swift: /path/to/swift/lib/AST/Expr.cpp:204: void swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool)::PropagateAccessKind::visit(swift::Expr *, swift::AccessKind): Assertion `(AllowOverwrite || !E->hasLValueAccessKind()) && "l-value access kind has already been set"' failed.
9  swift           0x0000000000fec937 swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool) + 23
13 swift           0x0000000000eaeb10 swift::TypeChecker::callWitness(swift::Expr*, swift::DeclContext*, swift::ProtocolDecl*, swift::ProtocolConformance*, swift::DeclName, llvm::MutableArrayRef<swift::Expr*>, swift::Diag<>) + 2688
17 swift           0x0000000000f80c3e swift::Expr::walk(swift::ASTWalker&) + 46
18 swift           0x0000000000eaa826 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
19 swift           0x0000000000e1f62b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
21 swift           0x0000000000ec6dd8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 5128
22 swift           0x0000000000eca8ee swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
23 swift           0x0000000000e19225 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>) + 661
24 swift           0x0000000000e1f5b9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
25 swift           0x0000000000e20730 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
26 swift           0x0000000000e208d9 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
29 swift           0x0000000000e3a366 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
31 swift           0x0000000000e809c6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
32 swift           0x0000000000e069fd swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
33 swift           0x0000000000cb0f4f swift::CompilerInstance::performSema() + 2975
35 swift           0x0000000000775357 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2487
36 swift           0x000000000076ff35 main + 2773
Stack dump:
0.	Program arguments: /path/to/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28216-swift-expr-propagatelvalueaccesskind-2422f6.o
1.	While type-checking declaration 0x596f8a0 at validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift:8:1
2.	While type-checking expression at [validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift:8:7 - line:8:11] RangeText="[[[]_"
3.	While type-checking expression at [validation-test/compiler_crashers/28216-swift-expr-propagatelvalueaccesskind.swift:8:7 - line:8:11] RangeText="[[[]_"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-01-19 10:48:53 +01:00
Slava Pestov
0d96017b0d Add some more detail to library evolution test readme 2016-01-18 23:27:50 -08:00