Slava Pestov
22aa032285
Sema: Clean up SE-0036 diagnostic a bit
...
Suggest a fix-it for unqualified references to all static members
from instance context, not just enum elements.
Also, fix a small problem with the fix-it for replacing protocol
names with 'Self' inside extension bodies -- we didn't handle nested
functions properly.
2016-08-05 14:27:16 -07:00
Slava Pestov
522f4e4572
AST: Replace recently-added IsInOut bit with simpler check, NFC
...
Thanks to @lattner for the suggestion.
2016-08-05 14:27:16 -07:00
Michael Ilseman
49e0685151
[noescape by default] drop superfluous @noescape from validation suite
2016-08-04 16:23:06 -07:00
Dmitri Gribenko
9654ebee52
Merge pull request #4007 from apple/coregraphics-tests
...
Convert CoreGraphics tests to StdlibUnittest
2016-08-04 13:15:11 -07:00
Dmitri Gribenko
b525e57a5b
Merge pull request #3997 from practicalswift/swiftc-28383-swift-constraints-constraintgraphnode-getmembertype
...
[swiftc (38 vs. 5155)] Add crasher in swift::constraints::ConstraintGraphNode::getMemberType(...)
2016-08-04 11:12:04 -07:00
Dmitri Gribenko
e0af6f9921
Convert CoreGraphics tests to StdlibUnittest
2016-08-04 10:36:43 -07:00
swift-ci
47fe3bd82c
Merge pull request #3945 from jckarter/foundation-overlay-post-0072
2016-08-04 09:50:05 -07:00
Dmitri Gribenko
2119a0e02a
Merge pull request #3993 from apple/spritekit-remove-redundant-tests
...
Remove redundant tests for SpriteKit
2016-08-04 09:38:14 -07:00
Joe Groff
62afa03eb9
Improve Foundation overlay to handle bridging subscripts and dictionary literals.
...
SE-0072 took implicit bridging conversions away, which regressed the ability to express NSDictionaries as dictionary literals and index them using literal keys. Address this by changing the signature of init(dictionaryLiteral:) to use Hashable and Any, and by replacing the subscript from Objective-C with one using _Hashable that does the bridging on the user's behalf. This largely restores the QoI of working with NS collections.
2016-08-04 08:42:36 -07:00
Dmitri Gribenko
48f852973b
Remove redundant tests for SpriteKit
...
These exact tests already exist in
validation-test/stdlib/SpriteKit.swift.
2016-08-04 02:04:08 -07:00
practicalswift
3ad815aeb2
[swiftc (38 vs. 5155)] Add crasher in swift::constraints::ConstraintGraphNode::getMemberType(...)
...
Add test case for crash triggered in `swift::constraints::ConstraintGraphNode::getMemberType(...)`.
Current number of unresolved compiler crashers: 38 (5155 resolved)
Stack trace:
```
6 swift 0x00000000010073e6 swift::constraints::ConstraintGraphNode::getMemberType(swift::Identifier, std::function<swift::TypeVariableType* ()>) + 182
7 swift 0x0000000001007fca swift::constraints::ConstraintGraph::getMemberType(swift::TypeVariableType*, swift::Identifier, std::function<swift::TypeVariableType* ()>) + 154
9 swift 0x0000000001157493 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 35
10 swift 0x0000000000f62f4b 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*> >&) + 1659
11 swift 0x0000000000f210a4 swift::TypeChecker::isProtocolExtensionUsable(swift::DeclContext*, swift::Type, swift::ExtensionDecl*) + 356
17 swift 0x000000000111ce14 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1188
18 swift 0x0000000000f14bf2 swift::TypeChecker::performTypoCorrection(swift::DeclContext*, swift::DeclRefKind, swift::Type, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>, swift::LookupResult&, unsigned int) + 290
19 swift 0x0000000000ebb32a swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) + 4058
21 swift 0x0000000001095c3b swift::Expr::walk(swift::ASTWalker&) + 27
22 swift 0x0000000000ebbbb0 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 224
23 swift 0x0000000000ec2a3d swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 621
24 swift 0x0000000000ec3bf0 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 352
25 swift 0x0000000000ec3e0b swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 267
32 swift 0x0000000000ed5a26 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
33 swift 0x0000000000ef9972 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026
34 swift 0x0000000000c7aa69 swift::CompilerInstance::performSema() + 3289
36 swift 0x00000000007db2c7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
37 swift 0x00000000007a7148 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28383-swift-constraints-constraintgraphnode-getmembertype.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28383-swift-constraints-constraintgraphnode-getmembertype-b45c8b.o
1. While type-checking 'c' at validation-test/compiler_crashers/28383-swift-constraints-constraintgraphnode-getmembertype.swift:13:1
2. While type-checking expression at [validation-test/compiler_crashers/28383-swift-constraints-constraintgraphnode-getmembertype.swift:14:16 - line:14:16] RangeText="g"
<unknown>:0: error: unable to execute command: Segmentation fault
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-08-04 10:22:50 +02:00
practicalswift
4154d6b317
Merge pull request #3934 from practicalswift/swiftc-28382-swift-archetypebuilder-maptypeoutofcontext
...
[swiftc (38 vs. 5154)] Add crasher in swift::ArchetypeBuilder::mapTypeOutOfContext(...)
2016-08-04 10:21:57 +02:00
Dmitri Gribenko
5d13d2a079
Merge pull request #3985 from apple/stdlib-int-stride-tests
...
stdlib: add tests for Stride types on integers
2016-08-04 00:19:57 -07:00
Doug Gregor
47f01ee98d
Revert "Eliminate race in swift_bridgeErrorToNSError."
...
This reverts commit e07e88706d . The
crash came back, so there's obviously more I need to investigate here:
https://ci.swift.org/job/swift-PR-osx-smoke-test/881/testReport/junit/Swift(macosx-x86_64)/stdlib/ErrorProtocol_swift/
2016-08-03 23:48:33 -07:00
Dmitri Gribenko
ee773c787a
stdlib: add tests for Stride types on integers
2016-08-03 18:57:39 -07:00
Dmitri Gribenko
86741b9ca1
Merge pull request #3960 from apple/spritekit-fixes
...
SpriteKit overlay: add a better variant of the SKWarpGeometryGrid() initializer overlay
2016-08-03 18:20:25 -07:00
Doug Gregor
e07e88706d
Eliminate race in swift_bridgeErrorToNSError.
...
Huge thanks to John for noting that 'consume' didn't provide the
guarantees we wanted, and to Michael G. for getting a TSan build up
and running to identify/verify this race.
It's possible that this is overlay strict, and that we only need to
look at the domain to ensure that the code and userInfo are
visible. However, TSan seems to prefix the form in this patch, so
we'll be more conservative for now.
Fixes rdar://problem/27541751.
2016-08-03 15:21:15 -07:00
Dmitri Gribenko
c41a9b6341
SpriteKit overlay: add a better variant of the SKWarpGeometryGrid() initializer overlay
2016-08-03 11:41:55 -07:00
Slava Pestov
75bd88968b
SILGen: Allow extensions to define designated initializers of generic types
...
Previously, if a generic type had a stored property with
a generic type and an initializer expression, we would
emit the expression directly in the body of each designated
initializer.
This is a problem if the designated initializer is defined
within an extension (even in the same source file), because
extensions have a different set of generic parameters and
archetypes.
Also, we've had bugs in the past where emitting an
expression multiple times didn't work properly. While these
might currently all be fixed, this is a tricky case to test
and it would be best to avoid it.
Fix both problems by emitting the initializer expression
inside its own function at the SIL level, and call the
initializer function from each designated initializer.
I'm using the existing 'variable initializer' mangling for this;
it doesn't seem to be used for anything else right now.
Currently, the default memberwise initializer does not use
this, because the machinery for emitting it is somewhat
duplicated and separate from the initializer expressions in
user-defined constructors. I'll clean this up in an upcoming
patch.
Fixes <https://bugs.swift.org/browse/SR-488 >.
2016-08-03 01:03:08 -07:00
Jordan Rose
848b3eb6a3
[Driver] Make sure to rebuild dependents when a dirty file fails. ( #3935 )
...
Otherwise we get into a situation like this:
1. Change made to the interface of file A.swift that also causes an
error in A.swift.
2. Fixing the error in A.swift does not affect A.swift's interface.
3. File B.swift that depends on A.swift is not rebuilt, since the most
recent change to A.swift did not change its interface.
To fix this, mark downstream files as needing to be rebuilt even when
a compilation job fails with errors. Additionally, attempt to be extra
conservative when there's a crash.
rdar://problem/25405605
2016-08-02 19:07:29 -07:00
practicalswift
496089c7b9
[swiftc (38 vs. 5154)] Add crasher in swift::ArchetypeBuilder::mapTypeOutOfContext(...)
...
Add test case for crash triggered in `swift::ArchetypeBuilder::mapTypeOutOfContext(...)`.
Current number of unresolved compiler crashers: 38 (5154 resolved)
Assertion failure in [`lib/AST/ArchetypeBuilder.cpp (line 2086)`](https://github.com/apple/swift/blob/master/lib/AST/ArchetypeBuilder.cpp#L2086 ):
```
Assertion `!canType->hasTypeParameter() && "already have an interface type"' failed.
When executing: static swift::Type swift::ArchetypeBuilder::mapTypeOutOfContext(swift::ModuleDecl *, swift::GenericParamList *, swift::Type)
```
Assertion context:
```
Type ArchetypeBuilder::mapTypeOutOfContext(ModuleDecl *M,
GenericParamList *genericParams,
Type type) {
auto canType = type->getCanonicalType();
assert(!canType->hasTypeParameter() && "already have an interface type");
if (!canType->hasArchetype())
return type;
assert(genericParams && "dependent type in non-generic context");
```
Stack trace:
```
swift: /path/to/swift/lib/AST/ArchetypeBuilder.cpp:2086: static swift::Type swift::ArchetypeBuilder::mapTypeOutOfContext(swift::ModuleDecl *, swift::GenericParamList *, swift::Type): Assertion `!canType->hasTypeParameter() && "already have an interface type"' failed.
8 swift 0x00000000010169b5 swift::ArchetypeBuilder::mapTypeOutOfContext(swift::ModuleDecl*, swift::GenericParamList*, swift::Type) + 293
11 swift 0x0000000000ecc972 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3394
12 swift 0x000000000113982b swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2667
13 swift 0x00000000011380b1 swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2833
14 swift 0x0000000000f0fc4b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
17 swift 0x0000000000f4190e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
19 swift 0x0000000000f42864 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
20 swift 0x0000000000f41800 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
21 swift 0x000000000100c83e swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 158
22 swift 0x0000000000fe2a0d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
23 swift 0x0000000000ec9279 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137
24 swift 0x0000000000ecc0cd swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1181
28 swift 0x0000000000f4190e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
30 swift 0x0000000000f42864 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
31 swift 0x0000000000f41800 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
34 swift 0x0000000000ecc972 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3394
37 swift 0x0000000000ed2096 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
40 swift 0x0000000000f3a50a swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
41 swift 0x0000000000f3a36e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
42 swift 0x0000000000f3af33 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
44 swift 0x0000000000ef5f71 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
45 swift 0x0000000000c76f49 swift::CompilerInstance::performSema() + 3289
47 swift 0x00000000007dadd7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
48 swift 0x00000000007a6ca8 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28382-swift-archetypebuilder-maptypeoutofcontext.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28382-swift-archetypebuilder-maptypeoutofcontext-e6d0cd.o
1. While type-checking getter for b at validation-test/compiler_crashers/28382-swift-archetypebuilder-maptypeoutofcontext.swift:10:6
2. While type-checking 'e' at validation-test/compiler_crashers/28382-swift-archetypebuilder-maptypeoutofcontext.swift:12:1
3. While type-checking 'e' at validation-test/compiler_crashers/28382-swift-archetypebuilder-maptypeoutofcontext.swift:12:1
4. While resolving type A at [validation-test/compiler_crashers/28382-swift-archetypebuilder-maptypeoutofcontext.swift:12:13 - line:12:13] RangeText="A"
5. While resolving type e at [validation-test/compiler_crashers/28382-swift-archetypebuilder-maptypeoutofcontext.swift:14:13 - line:14:13] RangeText="e"
6. While type-checking 'e' at validation-test/compiler_crashers/28382-swift-archetypebuilder-maptypeoutofcontext.swift:15:1
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
```
2016-08-02 22:04:48 +02:00
Mishal Shah
d28ff854b9
Update master to build with Xcode 8 beta 4, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs.
2016-08-02 11:47:10 -07:00
John McCall
afdda3d107
Implement SE-0117.
...
One minor revision: this lifts the proposed restriction against
overriding a non-open method with an open one. On reflection,
that was inconsistent with the existing rule permitting non-public
methods to be overridden with public ones. The restriction on
subclassing a non-open class with an open class remains, and is
in fact consistent with the existing access rule.
2016-08-02 07:46:38 -07:00
Jordan Rose
f42158b12e
Revert "[Sema] ban multi-arguments to tuple coercion" ( #3922 )
...
It breaks cases where there really is a single unlabeled argument of tuple type, like this:
let pairs = [(1, "A"), (2, "B")]
print(pairs.map { $0.0 })
2016-08-01 19:22:19 -07:00
Chris Williams
4caf64a223
Have FloatingPointConversion use float helper methods
2016-08-01 14:27:51 -07:00
Chris Williams
c8458cebc4
Create SwiftFloatingPointTypes for float-related helpers
2016-08-01 14:27:51 -07:00
Chris Williams
2f74e7618d
Add max/min helpers to SwiftIntTypes
2016-08-01 14:27:51 -07:00
Chris Williams
ae140e68a1
Tests for Float->Int Initializers
2016-08-01 14:27:51 -07:00
Nicole Jacque
65f933ea27
Disabling test until <rdar://problem/27541751> is resolved
2016-08-01 14:24:11 -07:00
Dmitri Gribenko
fc89bb1ac6
Merge pull request #3772 from practicalswift/swiftc-28379-swift-constraints-constraintsystem-diagnosefailureforexpr
...
[swiftc (35 vs. 5154)] Add crasher in swift::constraints::ConstraintSystem::diagnoseFailureForExpr(...)
2016-08-01 11:17:09 -07:00
Doug Gregor
f1706303a0
Merge pull request #3895 from dduan/se0110_a-pr
...
[Sema] ban multi-arguments to tuple coercion
2016-07-31 23:00:32 -07:00
Chris Lattner
ee52ecccf4
Validation tests shouldn't check for diagnostics.
2016-07-31 16:58:07 -07:00
Daniel Duan
c9b73dacc2
[Sema] ban multi-arguments to tuple coercion
...
Implements part of SE-0110. Single argument in closures will not be accepted if
there exists explicit type with a number of arguments that's not 1.
```swift
let f: (Int, Int) -> Void = { x in } // this is now an error
```
Note there's a second part of SE-0110 which could be considered additive,
which says one must add an extra pair of parens to specify a single arugment
type that is a tuple:
```swift
let g ((Int, Int)) -> Void = { y in } // y should have type (Int, Int)
```
This patch does not implement that part.
2016-07-31 16:22:57 -07:00
Dmitri Gribenko
d3194ecbe4
Merge pull request #3900 from practicalswift/swiftc-28381-swift-archetypebuilder-addrequirement
...
[swiftc (36 vs. 5154)] Add crasher in swift::ArchetypeBuilder::addRequirement(...)
2016-07-31 15:55:20 -07:00
Robert Widmann
979ff4eee6
Merge pull request #3894 from CodaFi/string-cheese-to-go
...
Restore test lost in transition to String(describing:)
2016-07-31 14:00:48 -07:00
practicalswift
bf2ef1e014
[swiftc (36 vs. 5154)] Add crasher in swift::ArchetypeBuilder::addRequirement(...)
...
Add test case for crash triggered in `swift::ArchetypeBuilder::addRequirement(...)`.
Current number of unresolved compiler crashers: 36 (5154 resolved)
Assertion failure in [`lib/AST/ArchetypeBuilder.cpp (line 1489)`](https://github.com/apple/swift/blob/master/lib/AST/ArchetypeBuilder.cpp#L1489 ):
```
Assertion `!invalid && "Re-introducing invalid requirement"' failed.
When executing: void swift::ArchetypeBuilder::addRequirement(const swift::Requirement &, swift::RequirementSource)
```
Assertion context:
```
(void)existential;
// Add each of the protocols.
for (auto proto : conformsTo) {
bool invalid = addConformanceRequirement(pa, proto, source);
assert(!invalid && "Re-introducing invalid requirement");
(void)invalid;
}
return;
}
```
Stack trace:
```
swift: /path/to/swift/lib/AST/ArchetypeBuilder.cpp:1489: void swift::ArchetypeBuilder::addRequirement(const swift::Requirement &, swift::RequirementSource): Assertion `!invalid && "Re-introducing invalid requirement"' failed.
8 swift 0x00000000010168bd swift::ArchetypeBuilder::addRequirement(swift::Requirement const&, swift::RequirementSource) + 605
9 swift 0x0000000001018553 swift::ArchetypeBuilder::addGenericSignature(swift::GenericSignature*, bool, bool) + 515
10 swift 0x0000000000f0c52f swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::GenericSignature*, bool, swift::GenericTypeResolver*) + 63
11 swift 0x0000000000f0df47 swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 135
12 swift 0x0000000000f0ea9f swift::TypeChecker::validateGenericTypeSignature(swift::GenericTypeDecl*) + 111
13 swift 0x0000000000ecd466 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1830
14 swift 0x000000000113b66b swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2667
15 swift 0x0000000001139efb swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2491
16 swift 0x0000000000f10d5b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
19 swift 0x0000000000f4322e 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 0x0000000000f44184 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
22 swift 0x0000000000f43120 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 192
23 swift 0x0000000000f14df9 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*) + 937
25 swift 0x0000000000ecdc4b swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3851
28 swift 0x0000000000f1be0e swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) + 1694
29 swift 0x0000000000f1c547 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) + 471
32 swift 0x0000000000ed31a6 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
35 swift 0x0000000000f3d154 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
36 swift 0x0000000000f696ac swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
37 swift 0x0000000000ec037a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 778
40 swift 0x0000000000f3d154 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
41 swift 0x0000000000f696ac swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
42 swift 0x0000000000ec037a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 778
44 swift 0x0000000000f3d296 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
45 swift 0x0000000000ef6fed swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1133
46 swift 0x0000000000c77d69 swift::CompilerInstance::performSema() + 3289
48 swift 0x00000000007db0d7 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
49 swift 0x00000000007a6fb8 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28381-swift-archetypebuilder-addrequirement.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28381-swift-archetypebuilder-addrequirement-cb9111.o
1. While type-checking expression at [validation-test/compiler_crashers/28381-swift-archetypebuilder-addrequirement.swift:10:1 - line:14:13] RangeText="{{
2. While type-checking expression at [validation-test/compiler_crashers/28381-swift-archetypebuilder-addrequirement.swift:10:2 - line:11:10] RangeText="{
3. While type-checking 'A' at validation-test/compiler_crashers/28381-swift-archetypebuilder-addrequirement.swift:11:1
4. While resolving type A at [validation-test/compiler_crashers/28381-swift-archetypebuilder-addrequirement.swift:12:7 - line:12:7] 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-07-31 19:54:15 +02:00
Dmitri Gribenko
bb6c6740ca
stdlib: fix a bug in ArraySlice.removeLast() when startIndex != 0
...
ArraySlice.removeLast() only worked when startIndex was equal to zero.
This change fixes the bug, and uses the proper customization point for
the algorithm.
Fixes SR-1791, rdar://problem/26897658.
2016-07-31 02:04:23 -07:00
Robert Widmann
f2165a6e64
Restore test lost in transition to String(describing:)
2016-07-30 18:14:00 -07:00
Dmitri Gribenko
fe1e1fc208
Merge pull request #3891 from practicalswift/swiftc-28380-swift-type-transform
...
[swiftc (35 vs. 5154)] Add crasher in swift::Type::transform(...)
2016-07-30 14:13:39 -07:00
practicalswift
0bf6376a56
[swiftc (35 vs. 5154)] Add crasher in swift::Type::transform(...)
...
Add test case for crash triggered in `swift::Type::transform(...)`.
Current number of unresolved compiler crashers: 35 (5154 resolved)
Stack trace:
```
5 swift 0x0000000001152d13 swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 35
6 swift 0x000000000115399f swift::Type::transform(llvm::function_ref<swift::Type (swift::Type)>) const + 3247
7 swift 0x0000000000f5ebde 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 0x000000000109170c swift::Expr::walk(swift::ASTWalker&) + 108
11 swift 0x0000000000faa0c8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) + 200
12 swift 0x0000000000eb8e93 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 0x0000000000ebfc8d swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 621
14 swift 0x0000000000ec1994 swift::TypeChecker::typeCheckCondition(swift::Expr*&, swift::DeclContext*) + 180
15 swift 0x0000000000ec1aeb swift::TypeChecker::typeCheckStmtCondition(llvm::MutableArrayRef<swift::StmtConditionElement>&, swift::DeclContext*, swift::Diag<>) + 251
19 swift 0x0000000000f3cb04 swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 244
20 swift 0x0000000000f690cc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 876
21 swift 0x0000000000ebfd2a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 778
24 swift 0x0000000000f3b7da swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 346
25 swift 0x0000000000f3b63e swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) + 46
26 swift 0x0000000000f3c203 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 179
28 swift 0x0000000000ef6a31 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1281
29 swift 0x0000000000c77be9 swift::CompilerInstance::performSema() + 3289
31 swift 0x00000000007daf57 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2887
32 swift 0x00000000007a6e38 main + 2872
Stack dump:
0. Program arguments: /path/to/swift/bin/swift -frontend -c -primary-file validation-test/compiler_crashers/28380-swift-type-transform.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -module-name main -o /tmp/28380-swift-type-transform-07a9ce.o
1. While type-checking 'f' at validation-test/compiler_crashers/28380-swift-type-transform.swift:9:1
2. While type-checking expression at [validation-test/compiler_crashers/28380-swift-type-transform.swift:9:10 - line:9:24] RangeText="{if true as[T.h"
3. While type-checking expression at [validation-test/compiler_crashers/28380-swift-type-transform.swift:9:14 - line:9:24] RangeText="true as[T.h"
<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-30 18:54:51 +02:00
Robert Widmann
e1ae0391e8
Fixup validation tests
2016-07-30 03:50:16 -07:00
Dmitri Gribenko
382d215ad3
stdlib: SE-0101: remove the last few uses of old APIs (sizeof, alignof, strideof)
2016-07-30 00:38:18 -07:00
Joe Groff
c748ba6c12
Merge pull request #3870 from jckarter/no-bridged-default-literal-types
...
Sema: Don't try bridged classes as default literal types.
2016-07-29 22:16:53 -07:00
Robert Widmann
b79fa44da5
Merge pull request #3878 from CodaFi/decltype
...
[SE-0096] Implement type(of:)
2016-07-29 18:05:01 -07:00
David Farler
cda5aef65c
Restrict dsohandle-multi-module.swift test to OS X
...
Investigating a problem with execution tests on other platforms
when building multiple dylibs and an executable that builds them.
rdar://problem/27620565
2016-07-29 17:56:45 -07:00
Dave Abrahams
f06a9a1154
Merge 'origin/master' into new-integer-protocols
2016-07-29 17:52:49 -07:00
Doug Gregor
b9363fe6bd
[SE-0111] Enable SE-0111 by default.
2016-07-29 17:28:24 -07:00
Robert Widmann
4f465224ea
Polish off uses of dynamicType in tests
2016-07-29 16:59:14 -07:00
Dmitri Gribenko
99dffd7682
Merge pull request #3854 from rintaro/SE-0101-memorylayout
...
[SE-0101] Implement: Reconfiguring sizeof and related functions into a unified MemoryLayout struct - Part 1
2016-07-29 15:56:27 -07:00
David Farler
3034b0139c
Merge pull request #3833 from bitjammer/dsohandle-multi-file-26565092
...
[SILGen] Directly silgen access of #dsohandle
2016-07-29 15:55:31 -07:00