Commit Graph

7628 Commits

Author SHA1 Message Date
Dmitri Gribenko
90eb232226 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-13 21:57:34 -07:00
practicalswift
feaa3a7ad0 [swiftc] Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:147: 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.
12 swift           0x0000000000fde105 swift::Expr::walk(swift::ASTWalker&) + 69
13 swift           0x0000000000ed2786 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
14 swift           0x0000000000e3548a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
16 swift           0x0000000000eec723 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 179
17 swift           0x0000000000ef11b0 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064
18 swift           0x0000000000e2ef33 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>) + 787
19 swift           0x0000000000e353e0 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576
23 swift           0x0000000000ea5a5a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
24 swift           0x0000000000ea58be swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
25 swift           0x0000000000ea6458 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
27 swift           0x0000000000e6a9f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
28 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
30 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
31 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28269-swift-expr-walk.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28269-swift-expr-walk-5303a6.o
1.	While type-checking getter for t at validation-test/compiler_crashers/28269-swift-expr-walk.swift:10:46
2.	While type-checking expression at [<invalid loc> - <invalid loc>]
3.	While type-checking expression at [<invalid loc> - <invalid loc>]
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-13 22:22:42 +01:00
practicalswift
1edb62dc38 [Python] Make flake8 linting pass without errors/warning (w/ default rules) 2016-03-13 20:19:51 +01:00
practicalswift
dace490553 [swiftc] Add test case for crash triggered in swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const
Stack trace:

```
swift: /path/to/llvm/include/llvm/Support/Casting.h:95: static bool llvm::isa_impl_cl<swift::SILFunctionType, const swift::TypeBase *>::doit(const From *) [To = swift::SILFunctionType, From = const swift::TypeBase *]: Assertion `Val && "isa<> used on a null pointer"' failed.
9  swift           0x0000000001096f1d swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 45
10 swift           0x000000000109156f swift::Type::subst(swift::ModuleDecl*, llvm::DenseMap<swift::TypeBase*, swift::Type, llvm::DenseMapInfo<swift::TypeBase*>, llvm::detail::DenseMapPair<swift::TypeBase*, swift::Type> >&, swift::OptionSet<swift::SubstFlags, unsigned int>) const + 111
13 swift           0x0000000000e8a11e swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*) + 254
14 swift           0x0000000001087d46 swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 150
15 swift           0x0000000001087c88 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 40
16 swift           0x0000000001088486 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
17 swift           0x0000000000e8210f swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1071
19 swift           0x0000000000eabdee swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
21 swift           0x0000000000eacd04 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
22 swift           0x0000000000eabcea swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
27 swift           0x0000000000e47556 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
30 swift           0x0000000000ea5a5a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
31 swift           0x0000000000ea58be swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
32 swift           0x0000000000ea6458 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
34 swift           0x0000000000e6a9f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
35 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
37 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
38 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28268-swift-type-transform.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28268-swift-type-transform-b6bd0e.o
1.	While type-checking declaration 0x648dd80 at validation-test/compiler_crashers/28268-swift-type-transform.swift:10:5
2.	While type-checking 'a' at validation-test/compiler_crashers/28268-swift-type-transform.swift:10:6
3.	While resolving type A.e at [validation-test/compiler_crashers/28268-swift-type-transform.swift:11:13 - line:11:15] RangeText="A.e"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-13 12:44:19 +01:00
practicalswift
a3dfb717ab [swiftc] Add test case for crash triggered in swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:147: 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           0x0000000000e89f3d swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 2237
17 swift           0x0000000000e47556 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
20 swift           0x0000000000ea6d8a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
21 swift           0x0000000000ed28bc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
22 swift           0x0000000000e3548a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
25 swift           0x0000000000ea5ead swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 845
26 swift           0x0000000000ea58b2 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 34
27 swift           0x0000000000ea6458 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
29 swift           0x0000000000e6a9f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
30 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
32 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
33 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28267-swift-typechecker-checkconformance-1f2757.o
1.	While type-checking 'init' at validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift:10:27
2.	While type-checking expression at [validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift:10:34 - line:10:44] RangeText="{enum S<h{c"
3.	While type-checking 'S' at validation-test/compiler_crashers/28267-swift-typechecker-checkconformance.swift:10:35
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-13 11:24:57 +01:00
practicalswift
dd94851de7 [swiftc] Add test case for crash triggered in swift::ModuleDecl::lookupPrefixOperator(swift::Identifier, swift::SourceLoc)
Stack trace:

```
6  swift           0x000000000310ab3d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461
7  swift           0x000000000106f570 swift::ModuleDecl::lookupPrefixOperator(swift::Identifier, swift::SourceLoc) + 0
9  swift           0x0000000000f66048 swift::ArchetypeBuilder::PotentialArchetype::addConformance(swift::ProtocolDecl*, swift::RequirementSource const&, swift::ArchetypeBuilder&) + 296
10 swift           0x0000000000f69a16 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 118
13 swift           0x0000000000f6b9ff swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
14 swift           0x0000000000f697ea swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 426
15 swift           0x0000000000f69b77 swift::ArchetypeBuilder::addConformanceRequirement(swift::ArchetypeBuilder::PotentialArchetype*, swift::ProtocolDecl*, swift::RequirementSource, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 471
18 swift           0x0000000000f6b9ff swift::ArchetypeBuilder::visitInherited(llvm::ArrayRef<swift::TypeLoc>, llvm::function_ref<bool (swift::Type, swift::SourceLoc)>) + 175
19 swift           0x0000000000f697ea swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&) + 426
20 swift           0x0000000000f6961c swift::ArchetypeBuilder::addGenericParameterRequirements(swift::GenericTypeParamDecl*) + 172
21 swift           0x0000000000e7d3f7 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 375
22 swift           0x0000000000e7eb07 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
23 swift           0x0000000000e7eea6 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
24 swift           0x0000000000e41f31 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1601
29 swift           0x0000000000e47556 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
30 swift           0x0000000000e6a8e2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1026
31 swift           0x0000000000cbcedf swift::CompilerInstance::performSema() + 3087
33 swift           0x000000000078b6ff frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
34 swift           0x00000000007861c5 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28266-swift-moduledecl-lookupprefixoperator.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28266-swift-moduledecl-lookupprefixoperator-bacf6e.o
1.	While type-checking 'B' at validation-test/compiler_crashers/28266-swift-moduledecl-lookupprefixoperator.swift:9:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-13 10:24:38 +01:00
Dmitri Gribenko
3bf4d15037 Merge pull request #1659 from practicalswift/swiftc-28265-swift-expr-walk
[swiftc] Add test case for crash triggered in swift::Expr::walk(…)
2016-03-12 19:30:12 -08:00
Patrick Pijnappel
4d05dc69a1 [stdlib] Resolve merge conflict in Unicode.swift 2016-03-13 14:08:23 +11:00
Ted Kremenek
6d045b0318 Merge pull request #1554 from JaSpa/enum-case-is-no-type
[AST/Sema] Don't crash when referencing enum case in where-clause
2016-03-12 16:52:53 -08:00
Dmitri Gribenko
45d45589a6 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-12 16:02:40 -08:00
practicalswift
4a0a62ce1f [swiftc] Add test case for crash triggered in swift::Expr::walk(swift::ASTWalker&)
Stack trace:

```
swift: /path/to/swift/lib/Sema/CSApply.cpp:2314: swift::Expr *(anonymous namespace)::ExprRewriter::applyMemberRefExpr(swift::Expr *, swift::Expr *, swift::SourceLoc, swift::DeclNameLoc, bool): Assertion `resultTy->hasUnresolvedType() && "Should have a selected member if we got a type"' failed.
13 swift           0x0000000000fdccbe swift::Expr::walk(swift::ASTWalker&) + 46
14 swift           0x0000000000ed1376 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 502
15 swift           0x0000000000e33eca swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
18 swift           0x0000000000eeb2c9 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 105
19 swift           0x0000000000eefda0 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4064
20 swift           0x0000000000e2d973 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>) + 787
21 swift           0x0000000000e33e20 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 576
22 swift           0x0000000000e35ad1 swift::TypeChecker::typeCheckCondition(swift::Expr*&, swift::DeclContext*) + 145
23 swift           0x0000000000e35c2b swift::TypeChecker::typeCheckStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>&, swift::DeclContext*, swift::Diag<>) + 251
27 swift           0x0000000000ea468a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
28 swift           0x0000000000ea44ee swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
29 swift           0x0000000000ea5088 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
31 swift           0x0000000000e69624 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
32 swift           0x0000000000cbc58f swift::CompilerInstance::performSema() + 3087
34 swift           0x000000000078b54f frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
35 swift           0x0000000000786015 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28265-swift-expr-walk.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28265-swift-expr-walk-d333bf.o
1.	While type-checking 'a' at validation-test/compiler_crashers/28265-swift-expr-walk.swift:10:9
2.	While type-checking expression at [validation-test/compiler_crashers/28265-swift-expr-walk.swift:10:19 - line:10:29] RangeText="c == .h.c=a"
3.	While type-checking expression at [validation-test/compiler_crashers/28265-swift-expr-walk.swift:10:19 - line:10:27] RangeText="c == .h.c"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-12 22:15:53 +01:00
Ben Langmuir
812d1566a7 [CodeCompletion] Don't look through non-type contexts in override
We don't actually want to skip non-type contexts here, since we should
only be showing override completions in the type context itself. This
was pretty obscure to hit in practice, but I noticed it while fixing the
crasher.
2016-03-12 08:39:11 -08:00
Janek Spaderna
8bca045718 [AST] Fail to compute the EnumElementDecl type in case of an ErrorType
If the resulting function type contains an ErrorType, this is an indicator that
something else is wrong. Bail out in this case.
This happened if an enum case was referenced inside the where-clause and treated
as a type.
2016-03-12 11:53:16 +01:00
practicalswift
d43320c01a [swiftc] Add test case for crash triggered in swift::ValueDecl::getInterfaceType() const
Stack trace:

```
4  swift           0x000000000103cc7c swift::ValueDecl::getInterfaceType() const + 12
5  swift           0x000000000103d836 swift::TypeDecl::getDeclaredInterfaceType() const + 6
6  swift           0x0000000000e7b8a1 swift::DependentGenericTypeResolver::resolveTypeOfContext(swift::DeclContext*) + 81
7  swift           0x0000000000ea979f swift::TypeChecker::resolveTypeInContext(swift::TypeDecl*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 911
11 swift           0x0000000000eaaa1e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
13 swift           0x0000000000eab934 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
14 swift           0x0000000000eaa91a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
15 swift           0x0000000000e7c162 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 690
16 swift           0x0000000000e7d737 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
17 swift           0x0000000000e7dad6 swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 102
18 swift           0x0000000000e40b42 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1554
23 swift           0x0000000000e46196 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
26 swift           0x0000000000ea59ba swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
27 swift           0x0000000000ed14ac swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
28 swift           0x0000000000e33eca swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 746
30 swift           0x0000000000ea5b06 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
31 swift           0x0000000000e6958d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149
32 swift           0x0000000000cbc58f swift::CompilerInstance::performSema() + 3087
34 swift           0x000000000078b54f frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2495
35 swift           0x0000000000786015 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28264-swift-valuedecl-getinterfacetype-d01804.o
1.	While type-checking expression at [validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift:9:1 - line:9:35] RangeText="{class A{typealias B<T where B:T>:v"
2.	While type-checking 'A' at validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift:9:2
3.	While resolving type B at [validation-test/compiler_crashers/28264-swift-valuedecl-getinterfacetype.swift:9:30 - line:9:30] 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-03-12 10:32:05 +01:00
Dmitri Gribenko
3cde854287 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-12 01:11:32 -08:00
Ben Langmuir
5bbc06b35c [CodeCompletion] Fix override completion parser lookback issues
This allows us to get override completions correct when
* There are multiple decls on one line
* The preceding attributes/keywords span multiple lines

Resolving a longstanding FIXME.
2016-03-11 23:00:11 -08:00
Ben Langmuir
47723848bd [CodeCompletion] Fix crash in override completion in a bogus context
Use the right context for getting the formal access. To get the
completions right, we should fix the FIXME about not backtracking the
parser so far.
2016-03-11 17:15:19 -08:00
Chris Lattner
583ea34d63 Merge pull request #1643 from practicalswift/swiftc-28263-swift-typechecker-validatedecl
[swiftc] Add test case for crash triggered in swift::TypeChecker::validateDecl(…)
2016-03-11 16:57:53 -08:00
Chris Lattner
21e1de1614 Merge pull request #1625 from practicalswift/swiftc-28262-swift-typechecker-applyunboundgenericarguments
[swiftc] Add test case for crash triggered in swift::TypeChecker::applyUnboundGenericArguments(…)
2016-03-11 16:57:32 -08:00
practicalswift
4ad5ed4ada [crashers] License: Apache License v2.0 with Runtime Library Exception 2016-03-11 22:35:33 +01:00
Slava Pestov
55519871e0 validation-tests: Don't use AnyObject dispatch in Dictionary.swift
Fixes <rdar://problem/25023473>.
2016-03-11 13:25:54 -08:00
Dmitri Gribenko
d268da0628 New indexing model: avoid allocations in fatalError() when the string buffer is already in UTF-8 2016-03-11 13:08:01 -08:00
practicalswift
fd215f8d68 [swiftc] Add test case for crash triggered in swift::TypeChecker::applyUnboundGenericArguments(swift::UnboundGenericType*, swift::SourceLoc, swift::DeclContext*, llvm::MutableArrayRef<swift::TypeLoc>, bool, swift::GenericTypeResolver*)
Stack trace:

```
swift: /path/to/swift/include/swift/AST/Decl.h:2439: swift::Type swift::TypeAliasDecl::getUnderlyingType() const: Assertion `!UnderlyingTy.getType().isNull() && "getting invalid underlying type"' failed.
8  swift           0x0000000000ea84f9 swift::TypeChecker::applyUnboundGenericArguments(swift::UnboundGenericType*, swift::SourceLoc, swift::DeclContext*, llvm::MutableArrayRef<swift::TypeLoc>, bool, swift::GenericTypeResolver*) + 1321
9  swift           0x0000000000ea7e7f swift::TypeChecker::applyGenericArguments(swift::Type, swift::SourceLoc, swift::DeclContext*, swift::GenericIdentTypeRepr*, bool, swift::GenericTypeResolver*) + 431
13 swift           0x0000000000ea864e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
15 swift           0x0000000000ea9564 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
16 swift           0x0000000000ea854a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
17 swift           0x0000000000f6086f swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 159
18 swift           0x0000000000f3f22d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
19 swift           0x0000000000f3f3b9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
20 swift           0x0000000000e3af40 swift::TypeChecker::resolveRawType(swift::EnumDecl*) + 64
21 swift           0x00000000010848bf swift::NominalTypeDecl::prepareConformanceTable() const + 351
22 swift           0x0000000001084b7f swift::NominalTypeDecl::getImplicitProtocols(llvm::SmallVectorImpl<swift::ProtocolDecl*>&) + 15
23 swift           0x0000000000e3b52c swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 1180
24 swift           0x0000000000e3e47f swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 527
29 swift           0x0000000000e43ed6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
33 swift           0x0000000000ea3736 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
34 swift           0x0000000000e671bd swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1149
35 swift           0x0000000000cb9d8f swift::CompilerInstance::performSema() + 3087
37 swift           0x000000000078ab9b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
38 swift           0x0000000000785645 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28262-swift-typechecker-applyunboundgenericarguments.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28262-swift-typechecker-applyunboundgenericarguments-a3dcd2.o
1.	While type-checking 'S' at validation-test/compiler_crashers/28262-swift-typechecker-applyunboundgenericarguments.swift:8:4
2.	While resolving type d<T> at [validation-test/compiler_crashers/28262-swift-typechecker-applyunboundgenericarguments.swift:8:20 - line:8:23] RangeText="d<T>"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-11 21:02:21 +01:00
practicalswift
87cda49520 [swiftc] Add test case for crash triggered in swift::TypeChecker::validateDecl(swift::ValueDecl*, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:6379: void swift::TypeChecker::validateDecl(swift::ValueDecl *, bool): Assertion `gp->getOuterParameters() == proto->getDeclContext()->getGenericParamsOfContext()' failed.
8  swift           0x0000000000e417fe swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 7134
9  swift           0x000000000107b82c swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 3612
10 swift           0x0000000001079ef0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
11 swift           0x0000000000e7f38b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
14 swift           0x0000000000eaa10e 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           0x0000000000eab024 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000eaa00a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000f623af swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 159
19 swift           0x0000000000f40d3d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
20 swift           0x0000000000e3c9f9 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137
21 swift           0x0000000000e4015b swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1339
22 swift           0x0000000000e3fcf1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 209
25 swift           0x0000000001073202 swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, 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*> >) + 1122
26 swift           0x000000000107a52a swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 3978
27 swift           0x0000000000e7f38b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
30 swift           0x0000000000e88c60 swift::TypeChecker::inferDefaultWitnesses(swift::ProtocolDecl*) + 288
31 swift           0x0000000000e69318 swift::finishTypeChecking(swift::SourceFile&) + 536
32 swift           0x0000000000cbb88a swift::CompilerInstance::performSema() + 3514
34 swift           0x000000000078ad8b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
35 swift           0x0000000000785835 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28263-swift-typechecker-validatedecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28263-swift-typechecker-validatedecl-5db636.o
1.	While resolving type c at [validation-test/compiler_crashers/28263-swift-typechecker-validatedecl.swift:14:13 - line:14:13] 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-03-11 20:59:45 +01:00
Slava Pestov
c846ca3939 Add library evolution tests for constructor, computed property, subscript default implementations 2016-03-11 11:27:06 -08:00
practicalswift
6cde815034 Merge pull request #1623 from practicalswift/make-slicetests-output-identical-to-pre-cleanup-outputs
[Python] Make slice tests output identical to pre-cleanup outputs
2016-03-11 16:05:37 +01:00
Ben Langmuir
5ca1c72381 Revert "Add library evolution tests for constructor, computed property, subscript default implementations"
This reverts commit a504d57e85.
2016-03-10 11:37:52 -08:00
practicalswift
7b1fd47f93 [Python] Make slice tests output identical to pre-cleanup outputs
In order to avoid introducing unnecessary diffs.
2016-03-10 19:48:12 +01:00
practicalswift
4d727a2f50 [swiftc] Add test case for crash triggered in swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest)
Stack trace:

```
swift: /path/to/swift/lib/Sema/IterativeTypeChecker.cpp:103: void swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest): Assertion `isSatisfied(request)' failed.
9  swift           0x0000000000f3f3b9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
10 swift           0x0000000000f3f3b9 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 889
13 swift           0x0000000000e3f115 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3749
16 swift           0x0000000000e43ed6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
17 swift           0x0000000000e67142 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1026
18 swift           0x0000000000cb9d8f swift::CompilerInstance::performSema() + 3087
20 swift           0x000000000078ab9b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
21 swift           0x0000000000785645 main + 2837
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28261-swift-iterativetypechecker-satisfy.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28261-swift-iterativetypechecker-satisfy-2b2db1.o
1.	While type-checking 'F' at validation-test/compiler_crashers/28261-swift-iterativetypechecker-satisfy.swift:8:1
2.	While type-checking 'F' at validation-test/compiler_crashers/28261-swift-iterativetypechecker-satisfy.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-03-10 16:57:23 +01:00
practicalswift
d6a7b2f517 [Python] Remove file level Python linting bypass ("noqa") 2016-03-10 13:33:57 +01:00
practicalswift
42b7e3f8d6 Merge pull request #1598 from practicalswift/fix-80-column-violations-in-python-code
[Python] Fix 80 column violations
2016-03-10 10:35:25 +01:00
Slava Pestov
a504d57e85 Add library evolution tests for constructor, computed property, subscript default implementations 2016-03-09 22:55:53 -08:00
gregomni
78b7b9681d A few final replacements of typealias with associatedtype.
Mismerge during my last commit made for a couple of leftovers that I didn't discover until now.
2016-03-09 20:45:46 -08:00
gregomni
78216b2990 Change all remaining tests that use typealias in a protocol to use associatedtype. 2016-03-09 18:08:52 -08:00
practicalswift
0796eaad1f [Python] Fix 80-column violations 2016-03-09 23:52:11 +01:00
Max Moiseev
1fae0d1325 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-08 12:48:48 -08:00
Mike Ferris
c237762923 Merge pull request #1578 from mike-ferris-apple/master
<rdar://problem/24814424> Add unit tests for the error handling suppo…
2016-03-08 11:14:13 -08:00
Mike Ferris
7fb274a643 <rdar://problem/24814424> Add unit tests for the error handling support in the XCTest swift overlay 2016-03-08 08:35:24 -08:00
practicalswift
a183c5fc9d [swiftc] Add test case for crash triggered in swift::constraints::ConstraintGraphNode::getMemberType(swift::Identifier, std::function<swift::TypeVariableType* ()>)
Stack trace:

```
6  swift           0x0000000000f56566 swift::constraints::ConstraintGraphNode::getMemberType(swift::Identifier, std::function<swift::TypeVariableType* ()>) + 182
7  swift           0x0000000000f5712a swift::constraints::ConstraintGraph::getMemberType(swift::TypeVariableType*, swift::Identifier, std::function<swift::TypeVariableType* ()>) + 154
9  swift           0x000000000109068d swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 45
10 swift           0x0000000000ec5ae6 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*> >&) + 1110
12 swift           0x000000000109068d swift::Type::transform(std::function<swift::Type (swift::Type)> const&) const + 45
13 swift           0x0000000000ec64fa 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
18 swift           0x0000000000e869a0 swift::TypeChecker::inferDefaultWitnesses(swift::ProtocolDecl*) + 288
19 swift           0x0000000000e67048 swift::finishTypeChecking(swift::SourceFile&) + 536
20 swift           0x0000000000cb63aa swift::CompilerInstance::performSema() + 3514
22 swift           0x000000000078a58b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
23 swift           0x0000000000785035 main + 2837
Stack dump:
0.	Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28260-swift-constraints-constraintgraphnode-getmembertype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28260-swift-constraints-constraintgraphnode-getmembertype-a2bfc8.o
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-08 11:36:24 +01:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
practicalswift
4c9a2d20d0 [swiftc] Add test case for crash triggered in swift::TypeChecker::validateDecl(swift::ValueDecl*, bool)
Stack trace:

```
swift: /path/to/swift/lib/Sema/TypeCheckDecl.cpp:4372: void (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl *): Assertion `!FD->getType()->hasTypeParameter()' failed.
10 swift           0x0000000000e3d6d4 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 788
12 swift           0x0000000000e3d6d4 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 788
13 swift           0x00000000010778fc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 3612
14 swift           0x0000000001075fc0 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2384
15 swift           0x0000000000e7c99b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
18 swift           0x0000000000ea745e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
20 swift           0x0000000000ea8374 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
21 swift           0x0000000000ea735a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
23 swift           0x0000000000e7910c swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 124
28 swift           0x0000000000e42f36 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
31 swift           0x0000000000ea178d swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) + 845
32 swift           0x0000000000ea1192 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 34
33 swift           0x0000000000ea1d38 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
35 swift           0x0000000000e662f4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
36 swift           0x0000000000cb5b9f swift::CompilerInstance::performSema() + 3087
38 swift           0x000000000078a49b frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
39 swift           0x0000000000784f45 main + 2837
Stack dump:
0.	Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28259-swift-typechecker-validatedecl-e3f732.o
1.	While type-checking 'init' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:11
2.	While type-checking 'S' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:18
3.	While resolving type d at [validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:35 - line:8:35] RangeText="d"
4.	While type-checking 'd' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.swift:8:37
5.	While type-checking 'd' at validation-test/compiler_crashers/28259-swift-typechecker-validatedecl.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-03-07 07:46:08 +01:00
practicalswift
2b4872c4d0 [swiftc] Add test case for crash triggered in swift::SpecializedProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const
Stack trace:

```
swift: /path/to/swift/lib/AST/Type.cpp:2126: TypeSubstitutionMap swift::GenericParamList::getSubstitutionMap(ArrayRef<swift::Substitution>) const: Assertion `Subs.empty() && "did not use all substitutions?!"' failed.
9  swift           0x000000000105a0ea swift::SpecializedProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 202
10 swift           0x0000000001059e02 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 18
11 swift           0x000000000105a616 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
12 swift           0x0000000000e5949a swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1066
14 swift           0x0000000000e82d7e 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           0x0000000000e83c84 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
17 swift           0x0000000000e82c7a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
18 swift           0x0000000000e1719a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5274
19 swift           0x0000000000e54775 swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 357
20 swift           0x0000000000e55e97 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
21 swift           0x0000000000e56244 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
22 swift           0x0000000000e18fe1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 353
29 swift           0x0000000000e1e936 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
32 swift           0x0000000000e7cc4a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
33 swift           0x0000000000e7caae swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
34 swift           0x0000000000e7d648 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 136
36 swift           0x0000000000e41dd4 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1300
37 swift           0x0000000000cb3b5f swift::CompilerInstance::performSema() + 3087
39 swift           0x00000000007885fb frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 2523
40 swift           0x00000000007830d5 main + 2773
Stack dump:
0.	Program arguments: /usr/local/bin/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl-a81e65.o
1.	While type-checking '<' at validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift:8:1
2.	While type-checking 'c' at validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift:8:7
3.	While resolving type A.e at [validation-test/compiler_crashers/28258-swift-specializedprotocolconformance-gettypewitnesssubstanddecl.swift:8:72 - line:8:74] RangeText="A.e"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-03-06 22:00:43 +01:00
practicalswift
4c3bca8e04 [gardening] Fix recently introduced typo: "accidently" → "accidentally" 2016-03-05 08:47:36 +01:00
Michael Gottesman
9a5c3eabf2 Merge pull request #968 from ezephir/linux-validation-dictionary-input
[StdLib] Refactor DictionaryKeyValueTypes test input data
2016-03-04 22:54:42 -08:00
Arnold Schwaighofer
0b181a1861 Don't throw away the top bits of our hashed value for strings on 64bit platforms
SR-877
rdar://24918173
2016-03-04 14:29:02 -08:00
Max Moiseev
cf4bafe9e3 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-03 13:22:03 -08:00
Slava Pestov
6bf9ab19ff Add preliminary library evolution test for resiliently adding a new protocol requirement
This test ensures that the runtime correctly instantiates resilient conformances,
and that IRGen emits the correct metadata, allowing a conformance that was
compiled before a new requirement was added to present a default implementation
of this requirement.

For now, this runs with --no-backward-deployment, so we only test before/before,
before/after and after/after cases.

Getting after/before working is also an expected capability here, but requires
IRGen witness table emission to know which requirements were satisfied by
defaults, so that they can be dropped if they appear at the end of a witness
table. In turn, this requires serializing SILDefaultWitnessTables. This will
be added in a subsequent patch.

In addition to fixing the above case, I need to write additional tests and
possibly fix bugs related to more elaborate cases involving generics, as well as
default witnesses for properties and subscripts.
2016-03-03 07:37:00 -08:00
Patrick Pijnappel
49741cfdd9 [stdlib] Rewrite UTF8 decoding 2016-03-03 23:30:00 +11:00
practicalswift
e33f1747a9 [Python] Improve Python consistency: "variable in function should be lowercase" (N806)
The repo contains roughly 80 Python scripts. "snake_case" naming is used for
local variables in all those scripts. This is the form recommended by the PEP 8
naming recommendations (Python Software Foundation) and typically associated
with idiomatic Python code.

However, in nine of the 80 scripts there were at least one instance of
"camelCase" naming prior to this commit.

This commit improves consistency in the Python code base by making sure that
these nine remaining files follow the variable naming convention used for
Python code in the project.

References:
* PEP 8: https://www.python.org/dev/peps/pep-0008/
* pep8-naming: https://pypi.python.org/pypi/pep8-naming
2016-03-02 18:56:47 +01:00
Max Moiseev
859db53d87 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-01 12:56:26 -08:00