Commit Graph

3633 Commits

Author SHA1 Message Date
Michael Gottesman
fc37603c5f Revert "Implement SE-0118" 2016-07-18 16:44:58 -07:00
Andrew Trick
0230efc614 Rename UnsafePointer assign/initialize and eliminate Backward variants. (#3585)
Also fixes the comments to clarify that source and self memory
must be disjoint.
2016-07-18 15:15:47 -07:00
practicalswift
a1539f5331 [swiftc] Add non-fuzzing crash case submitted by @kiliankoe
Credits: https://twitter.com/kiliankoe/status/752090953977036800
2016-07-18 23:43:35 +02:00
Dave Abrahams
da2947f079 encode(_:output:) => encode(_:into processCodeUnit:) 2016-07-18 14:30:46 -06:00
Dave Abrahams
7987b8549b first/contains(predicate) => first/contains(where: predicate) 2016-07-18 14:29:09 -06:00
Dave Abrahams
4bb21b8a2f _ includeElement/whereElementsSatisfy predicate => _ isIncluded 2016-07-18 14:29:09 -06:00
Dave Abrahams
f3ccc956c6 isOrderedBefore: => by areInIncreasingOrder: 2016-07-18 14:29:09 -06:00
practicalswift
19d579b0a0 [SourceKit] Add test case for crash triggered in swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext*, swift::DeclContext*, llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Requirement>, bool, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&)
Stack trace:

```
found code completion token A at offset 180
4  swift-ide-test  0x0000000000a19f12 swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext*, swift::DeclContext*, llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Requirement>, bool, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 994
6  swift-ide-test  0x0000000000c76783 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 35
7  swift-ide-test  0x0000000000a1862e swift::constraints::ConstraintSystem::openType(swift::Type, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 78
10 swift-ide-test  0x0000000000bb7fd5 swift::Expr::walk(swift::ASTWalker&) + 69
11 swift-ide-test  0x0000000000930838 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
12 swift-ide-test  0x000000000096b3b3 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>) + 371
13 swift-ide-test  0x0000000000971d52 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610
14 swift-ide-test  0x0000000000972f07 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
15 swift-ide-test  0x000000000097311b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
17 swift-ide-test  0x000000000097e79d swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3853
20 swift-ide-test  0x0000000000c3ae22 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 562
36 swift-ide-test  0x0000000000bb8384 swift::Decl::walk(swift::ASTWalker&) + 20
37 swift-ide-test  0x0000000000c500fe swift::SourceFile::walk(swift::ASTWalker&) + 174
38 swift-ide-test  0x0000000000c4f23f swift::ModuleDecl::walk(swift::ASTWalker&) + 79
39 swift-ide-test  0x0000000000c25e2b swift::DeclContext::walkContext(swift::ASTWalker&) + 187
40 swift-ide-test  0x00000000008ec518 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
41 swift-ide-test  0x00000000007a672d swift::CompilerInstance::performSema() + 3597
42 swift-ide-test  0x0000000000749d20 main + 34176
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl declaration 0x4e04dd0 at <INPUT-FILE>:3:1
2.	While type-checking expression at [<INPUT-FILE>:5:7 - line:5:7] RangeText="B"
```
2016-07-18 21:10:17 +02:00
swift-ci
103b6b89f4 Merge pull request #3567 from apple/stdlib-remove-boolean 2016-07-18 06:08:47 -07:00
Dmitri Gribenko
3fbd61291d tests: adapt to removal of Boolean protocol 2016-07-18 02:41:21 -07:00
Dmitri Gribenko
b868fb1a50 stdlib tests: adapt to removal of Bool.boolValue 2016-07-18 02:41:20 -07:00
practicalswift
fd8faa579d [swiftc (70 vs. 5108)] Add crasher in swift::Expr::propagateLValueAccessKind(...)
Add test case for crash triggered in `swift::Expr::propagateLValueAccessKind(...)`.

Current number of unresolved compiler crashers: 70 (5108 resolved)

Stack trace:

```
6  swift           0x00000000032c80ad llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 461
8  swift           0x00000000010f4c67 swift::Expr::propagateLValueAccessKind(swift::AccessKind, bool) + 23
12 swift           0x000000000107c7d5 swift::Expr::walk(swift::ASTWalker&) + 69
13 swift           0x0000000000f5bed2 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 514
14 swift           0x0000000000eb6971 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
17 swift           0x0000000000f7b572 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 13586
18 swift           0x0000000000f7d74e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 3998
19 swift           0x0000000000eb0112 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 850
20 swift           0x0000000000eb68d2 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610
21 swift           0x0000000000eb7a87 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 343
22 swift           0x0000000000eb8785 swift::TypeChecker::typeCheckStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>&, swift::DeclContext*, swift::Diag<>) + 373
25 swift           0x0000000000f303b6 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
26 swift           0x0000000000eea4bd swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133
27 swift           0x0000000000c6f629 swift::CompilerInstance::performSema() + 3289
29 swift           0x00000000007d8f39 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
30 swift           0x00000000007a4f58 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28368-swift-expr-propagatelvalueaccesskind.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28368-swift-expr-propagatelvalueaccesskind-c5a6ea.o
1.	While type-checking expression at [validation-test/compiler_crashers/28368-swift-expr-propagatelvalueaccesskind.swift:9:13 - line:9:19] RangeText=".h.a=[]"
2.	While type-checking expression at [validation-test/compiler_crashers/28368-swift-expr-propagatelvalueaccesskind.swift:9:13 - line:9:19] RangeText=".h.a=[]"
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-07-18 10:50:16 +02:00
Chris Lattner
0917c01922 update validation tests for Boolean removal. 2016-07-17 22:49:20 -07:00
swift-ci
8ca108521c Merge pull request #3558 from parkera/calendar_timezone_locale 2016-07-17 20:34:07 -07:00
swift-ci
391e10e6fe Merge pull request #3561 from practicalswift/sourcekit-071-swift-printoptions-setarchetypetransform 2016-07-17 18:09:18 -07:00
Michael Gottesman
a047bb7564 Revert "Fix the build."
This reverts commit dc24c2bd34.

Turns out Chris fixed the build but when I was looking at the bots, his fix had
not been tested yet, so I thought the tree was still red and was trying to
revert to green.
2016-07-17 16:29:18 -07:00
Michael Gottesman
dc24c2bd34 Fix the build.
This reverts commit b4cba58330.
This reverts commit a602927c75.
This reverts commit 55fbe5a763.
2016-07-17 16:17:15 -07:00
Chris Lattner
b4cba58330 With the removal of Boolean, this test is now valid. 2016-07-17 15:49:54 -07:00
practicalswift
4e4fff4373 [SourceKit] Add test case for crash triggered in swift::PrintOptions::setArchetypeTransform(swift::Type, swift::DeclContext*)
Stack trace:

```
found code completion token A at offset 154
swift-ide-test: /path/to/swift/lib/AST/ASTPrinter.cpp:68: std::unique_ptr<llvm::DenseMap<StringRef, Type> > swift::collectNameTypeMap(swift::Type): Assertion `ParamDecls.size() == Args.size()' failed.
9  swift-ide-test  0x0000000000b7da00 swift::PrintOptions::setArchetypeTransform(swift::Type, swift::DeclContext*) + 144
16 swift-ide-test  0x0000000000bb3694 swift::Decl::walk(swift::ASTWalker&) + 20
17 swift-ide-test  0x0000000000c4b40e swift::SourceFile::walk(swift::ASTWalker&) + 174
18 swift-ide-test  0x0000000000c4a54f swift::ModuleDecl::walk(swift::ASTWalker&) + 79
19 swift-ide-test  0x0000000000c2113b swift::DeclContext::walkContext(swift::ASTWalker&) + 187
20 swift-ide-test  0x00000000008ec438 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 136
21 swift-ide-test  0x00000000007a668d swift::CompilerInstance::performSema() + 3597
22 swift-ide-test  0x0000000000749c80 main + 34176
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While walking into decl getter for b at <INPUT-FILE>:3:6
```
2016-07-17 23:26:13 +02:00
practicalswift
eec2765613 Merge pull request #3557 from practicalswift/sil-026-swift-parser-parsesildefaultwitnesstable
[SIL] Add test case for crash triggered in swift::Parser::parseSILDefaultWitnessTable()
2016-07-17 22:58:36 +02:00
swift-ci
280515ae36 Merge pull request #3556 from practicalswift/sourcekit-070-swift-archetypebuilder-maptypeintocontext 2016-07-17 11:34:14 -07:00
Tony Parker
8e814ac875 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-17 09:42:37 -07:00
practicalswift
6fcbf7492b [SIL] Add test case for crash triggered in swift::Parser::parseSILDefaultWitnessTable()
Stack trace:

```
<stdin>:3:26: error: expected SIL value name
sil_default_witness_table
                         ^
sil-opt: /path/to/swift/include/swift/Parse/Parser.h:412: swift::SourceLoc swift::Parser::consumeToken(swift::tok): Assertion `Tok.is(K) && "Consuming wrong token kind"' failed.
8  sil-opt         0x0000000000a5d1d8 swift::Parser::parseSILDefaultWitnessTable() + 2248
9  sil-opt         0x0000000000a9452b swift::Parser::parseTopLevel() + 779
10 sil-opt         0x0000000000a4e0c0 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 208
11 sil-opt         0x0000000000772146 swift::CompilerInstance::performSema() + 3254
12 sil-opt         0x000000000075b63d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	With parser at source location: <stdin>:3:26
```
2016-07-17 12:04:17 +02:00
practicalswift
581103d766 [SourceKit] Add test case for crash triggered in swift::ArchetypeBuilder::mapTypeIntoContext(swift::ModuleDecl*, swift::GenericParamList*, swift::Type, swift::LazyResolver*)
Stack trace:

```
found code completion token A at offset 151
4  swift-ide-test  0x0000000000b3c793 swift::ArchetypeBuilder::mapTypeIntoContext(swift::ModuleDecl*, swift::GenericParamList*, swift::Type, swift::LazyResolver*) + 163
5  swift-ide-test  0x0000000000a19f1b swift::constraints::ConstraintSystem::openGeneric(swift::DeclContext*, swift::DeclContext*, llvm::ArrayRef<swift::GenericTypeParamType*>, llvm::ArrayRef<swift::Requirement>, bool, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 1051
7  swift-ide-test  0x0000000000c71a83 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 35
8  swift-ide-test  0x0000000000a185fe swift::constraints::ConstraintSystem::openType(swift::Type, swift::constraints::ConstraintLocatorBuilder, llvm::DenseMap<swift::CanType, swift::TypeVariableType*, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, swift::TypeVariableType*> >&) + 78
11 swift-ide-test  0x0000000000bb32e5 swift::Expr::walk(swift::ASTWalker&) + 69
12 swift-ide-test  0x0000000000930758 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
13 swift-ide-test  0x000000000096b353 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>) + 371
14 swift-ide-test  0x0000000000971cf2 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 610
17 swift-ide-test  0x00000000009ebae4 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
18 swift-ide-test  0x0000000000a229ac swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
19 swift-ide-test  0x0000000000971d91 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 769
22 swift-ide-test  0x00000000009ea75a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
23 swift-ide-test  0x00000000009ea5be swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
24 swift-ide-test  0x00000000009a89af swift::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 655
26 swift-ide-test  0x00000000008ec4e1 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 305
27 swift-ide-test  0x00000000007a668d swift::CompilerInstance::performSema() + 3597
28 swift-ide-test  0x0000000000749c80 main + 34176
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking expression at [<INPUT-FILE>:3:23 - line:4:1] RangeText="{B
"
2.	While type-checking expression at [<INPUT-FILE>:3:24 - line:3:24] RangeText="B"
```
2016-07-17 12:03:10 +02:00
Mark Lacey
65bf35d48b Merge remote-tracking branch 'origin/master' into master-next 2016-07-16 23:25:30 -07:00
Andrew Trick
888ff1ae99 Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 46a9f57329.

This broke Swift CI, OSS incremental RA:

./swift/stdlib/public/SDK/Foundation/TimeZone.swift:228:45: error: 'NSTimeZone' is not implicitly convertible to 'TimeZone'; did you mean to use 'as' to explicitly convert?
        return lhs._wrapped.isEqual(to: rhs._wrapped)
2016-07-16 18:34:32 -07:00
Tony Parker
46a9f57329 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-16 17:58:27 -07:00
Andrew Trick
7b5723b9a5 Revert "New value types for Calendar, TimeZone, and Locale"
This reverts commit 9c1f21bdf0.

This breaks swift-ci for everyone:

stdlib/public/SDK/Foundation/Calendar.swift:426:74: error: 'DateInterval' is only available on iOS 10.0 or newer
    public func dateInterval(of component: Component, for date: Date) -> DateInterval? {
2016-07-16 17:08:06 -07:00
Dmitri Gribenko
215786961a Merge pull request #3550 from practicalswift/sil-025-swift-typechecker-resolvetype
[SIL] Add test case for crash triggered in swift::TypeChecker::resolveType(…)
2016-07-16 16:34:55 -07:00
swift-ci
f9d919e465 Merge pull request #3549 from practicalswift/sourcekit-069-swift-typechecker-typecheckparameterlist 2016-07-16 16:31:04 -07:00
swift-ci
000a3fe455 Merge pull request #3551 from practicalswift/swiftc-28367-swift-declcontext-isgenericcontext 2016-07-16 16:28:35 -07:00
Tony Parker
9c1f21bdf0 New value types for Calendar, TimeZone, and Locale
As part of the extensive work on value types in Foundation this year, we
decided to also add value types for these three key classes. In addition
to adding value semantics, the API was extensively audited to improve
Swift interop (especially Calendar).

rdar://26628184
2016-07-16 15:48:08 -07:00
practicalswift
0a3666e72b [swiftc (69 vs. 5108)] Add crasher in swift::DeclContext::isGenericContext(...)
Add test case for crash triggered in `swift::DeclContext::isGenericContext(...)`.

Current number of unresolved compiler crashers: 69 (5108 resolved)

Stack trace:

```
4  swift           0x00000000010e5f27 swift::DeclContext::isGenericContext() const + 23
5  swift           0x00000000010dcea9 swift::ClassDecl::checkObjCAncestry() const + 185
6  swift           0x0000000000ebc685 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 421
7  swift           0x000000000111c5cb swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2667
8  swift           0x000000000111acaf swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2495
9  swift           0x0000000000efe1cb swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
12 swift           0x0000000000f2fd6e 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           0x0000000000f30cc4 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
15 swift           0x0000000000f2fc60 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
16 swift           0x0000000000ebb05a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 5194
17 swift           0x0000000000ebc658 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 376
22 swift           0x0000000000ec1c86 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
25 swift           0x0000000000f2899a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
26 swift           0x0000000000f287fe swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
27 swift           0x0000000000f293c3 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
29 swift           0x0000000000ee3f41 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
30 swift           0x0000000000c6f749 swift::CompilerInstance::performSema() + 3289
32 swift           0x00000000007d8f39 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
33 swift           0x00000000007a4f58 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28367-swift-declcontext-isgenericcontext.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28367-swift-declcontext-isgenericcontext-30331b.o
1.	While type-checking getter for a at validation-test/compiler_crashers/28367-swift-declcontext-isgenericcontext.swift:9:6
2.	While type-checking 'A' at validation-test/compiler_crashers/28367-swift-declcontext-isgenericcontext.swift:9:9
3.	While resolving type d at [validation-test/compiler_crashers/28367-swift-declcontext-isgenericcontext.swift:9:28 - line:9:28] RangeText="d"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-07-16 21:10:41 +02:00
practicalswift
976fc052f8 [SIL] Add test case for crash triggered in swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*)
Stack trace:

```
<stdin>:3:18: error: expected '(' in argument list of function declaration
protocol l{func t-> <T>()->(
                 ^
<stdin>:3:29: error: expected type
protocol l{func t-> <T>()->(
                            ^
<stdin>:3:29: error: expected ',' separator
protocol l{func t-> <T>()->(
                            ^
                            ,
<stdin>:3:29: error: consecutive declarations on a line must be separated by ';'
protocol l{func t-> <T>()->(
                            ^
                            ;
<stdin>:3:29: error: expected declaration
protocol l{func t-> <T>()->(
                            ^
<stdin>:3:10: note: in declaration of 'l'
protocol l{func t-> <T>()->(
         ^
sil-opt: /path/to/swift/lib/Sema/TypeCheckType.cpp:1964: swift::Type (anonymous namespace)::TypeResolver::resolveASTFunctionType(swift::FunctionTypeRepr *, TypeResolutionOptions, FunctionType::ExtInfo): Assertion `genericSig != nullptr && "Did not call handleSILGenericParams()?"' failed.
9  sil-opt         0x0000000000b5a904 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
10 sil-opt         0x0000000000b598a0 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
12 sil-opt         0x0000000000b2398e swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 94
17 sil-opt         0x0000000000aea496 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
18 sil-opt         0x0000000000b0d762 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
19 sil-opt         0x0000000000772259 swift::CompilerInstance::performSema() + 3289
20 sil-opt         0x000000000075b72d main + 1805
Stack dump:
0.	Program arguments: sil-opt -enable-sil-verify-all
1.	While type-checking 'l' at <stdin>:3:1
2.	While resolving type () -> () at [<stdin>:3:24 - line:3:28] RangeText="()->("
```
2016-07-16 21:09:42 +02:00
practicalswift
6b8d883948 [SourceKit] Add test case for crash triggered in swift::TypeChecker::typeCheckParameterList(swift::ParameterList*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*)
Stack trace:

```
found code completion token A at offset 137
5  swift-ide-test  0x00000000009c30f5 swift::TypeChecker::typeCheckParameterList(swift::ParameterList*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 117
8  swift-ide-test  0x0000000000982d96 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
9  swift-ide-test  0x00000000009a6142 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
10 swift-ide-test  0x00000000007a64d9 swift::CompilerInstance::performSema() + 3289
11 swift-ide-test  0x0000000000749c4a main + 34106
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'b' at <INPUT-FILE>:3:1
```
2016-07-16 21:09:27 +02:00
Dmitri Gribenko
1d3f595955 stdlib: re-enable validation-test/stdlib/String.swift 2016-07-15 20:33:47 -07:00
Michael Gottesman
40e1991e12 Revert "Name and label changes for closure parameters (for review only) (#2981)"
This reverts commit 18406900ba.
2016-07-15 19:45:26 -07:00
Mark Lacey
1c00ac4c6d Merge remote-tracking branch 'origin/master' into master-next
Conflicts:
	lib/IRGen/IRGen.cpp
	test/DebugInfo/parent-scope.swift
2016-07-15 19:23:53 -07:00
Dmitri Gribenko
1ce9219c7c Merge pull request #3532 from apple/stdlib-use-expectCollectionAssociatedTypes
stdlib: String tests: use expectCollectionAssociatedTypes()
2016-07-15 17:43:55 -07:00
Dave Abrahams
18406900ba Name and label changes for closure parameters (for review only) (#2981)
Implement SE-0118 Name and label changes for closure parameters

[SE-0118](https://github.com/apple/swift-evolution/blob/master/proposals/0118-closure-parameter-names-and-labels.md)
2016-07-15 15:31:48 -07:00
Michael Gottesman
16143ca41f Disable test to unbreak the build.
rdar://27381049
2016-07-15 15:08:54 -07:00
Dmitri Gribenko
0e886ce26c stdlib: String tests: use expectCollectionAssociatedTypes() 2016-07-15 10:45:56 -07:00
swift-ci
6e85962970 Merge pull request #3515 from apple/array-bridge 2016-07-14 15:53:41 -07:00
Dmitri Gribenko
5e11b828b2 Merge pull request #3511 from practicalswift/swiftc-28366-swift-archetypebuilder-finalize
[swiftc (68 vs. 5108)] Add crasher in swift::ArchetypeBuilder::finalize(...)
2016-07-14 13:06:51 -07:00
Dave Abrahams
b21d8bea92 [stdlib] Bridging [aClass] to ObjC in O(1) (redux #2)
There's no need for a deferred conversion in these cases.

This time committing ALL the changes needed to get the validation tests to pass.
2016-07-14 12:45:54 -07:00
practicalswift
7b8a834c30 [swiftc (68 vs. 5108)] Add crasher in swift::ArchetypeBuilder::finalize(...)
Add test case for crash triggered in `swift::ArchetypeBuilder::finalize(...)`.

Current number of unresolved compiler crashers: 68 (5108 resolved)

Assertion failure in [`lib/AST/ArchetypeBuilder.cpp (line 1686)`](https://github.com/apple/swift/blob/master/lib/AST/ArchetypeBuilder.cpp#L1686):

```
Assertion `dist > 0 && "nested type should have matched associated type"' failed.

When executing: swift::Identifier typoCorrectNestedType(ArchetypeBuilder::PotentialArchetype *)
```

Assertion context:

```
        continue;

      unsigned dist = name.edit_distance(assocType->getName().str(),
                                         /*allowReplacements=*/true,
                                         maxScore);
      assert(dist > 0 && "nested type should have matched associated type");
      if (bestEditDistance == 0 || dist == bestEditDistance) {
        bestEditDistance = dist;
        maxScore = bestEditDistance;
        bestMatches.push_back(assocType->getName());
      } else if (dist < bestEditDistance) {
```
Stack trace:

```
swift: /path/to/swift/lib/AST/ArchetypeBuilder.cpp:1686: swift::Identifier typoCorrectNestedType(ArchetypeBuilder::PotentialArchetype *): Assertion `dist > 0 && "nested type should have matched associated type"' failed.
8  swift           0x0000000000ff6e37 swift::ArchetypeBuilder::finalize(swift::SourceLoc) + 2231
9  swift           0x0000000000ef1ee7 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 183
10 swift           0x0000000000ef2a1f swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 111
11 swift           0x0000000000eb32fb swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 363
16 swift           0x0000000000eb8936 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
17 swift           0x0000000000edaaf2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
18 swift           0x0000000000c66849 swift::CompilerInstance::performSema() + 3289
20 swift           0x00000000007d8bb9 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2857
21 swift           0x00000000007a4bd8 main + 2872
Stack dump:
0.	Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28366-swift-archetypebuilder-finalize.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28366-swift-archetypebuilder-finalize-f3dc29.o
1.	While type-checking 'A' at validation-test/compiler_crashers/28366-swift-archetypebuilder-finalize.swift:11:2
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-07-14 17:21:16 +02:00
Nate Cook
3d2d3423ab [stdlib] Add test for Collection associated type inference 2016-07-14 02:23:28 -05:00
Vivian Kong
7080a54237 Fix PersistentVector test for s390x 2016-07-13 13:35:24 -04:00
Dmitri Gribenko
cf93e65824 Merge pull request #3489 from practicalswift/swiftc-28365-swift-constraints-constraintgraphnode-getmembertype
[swiftc (67 vs. 5108)] Add crasher in swift::constraints::ConstraintGraphNode::getMemberType(…)
2016-07-13 09:38:45 -07:00
Dmitri Gribenko
2bf19132de Merge pull request #3452 from natecook1000/nc-utf8index-nocore
[stdlib] Remove _StringCore from UTF8View.Index
2016-07-13 09:11:29 -07:00