swift-ci
70d818b479
Merge pull request #6091 from xedin/cs_crashers
2016-12-05 21:33:18 -08:00
Xi Ge
1f7a5f4412
Fixing /IDE/crashers/016-swift-mangle-mangler-mangleidentifier.swift ( #6079 )
2016-12-05 21:20:35 -08:00
Xi Ge
1570f8e4f1
Fixing IDE/crashers/091-swift-typechecker-computedefaultaccessibility.swift ( #6084 )
2016-12-05 20:52:07 -08:00
Pavel Yaskevich
712052bc9a
[QoI] Mark inactive constraints as retired after removing
...
This makes sure that removed constraints are returned back to the
system after current run, otherwise only constraint graph would
get them back since it has its own scope.
2016-12-05 20:50:32 -08:00
swift-ci
e0bec70809
Merge pull request #6090 from bitjammer/guard-null-generic-env
2016-12-05 19:59:12 -08:00
David Farler
25e623addb
Don't resolve a generic type parameter type from null environments
...
The generic environment of a GenericTypeToArchetypeResolver may be
`nullptr`, as returned by DeclContext::getGenericEnvironmentOfContext,
during prechecking of closure expressions at the necessarily non-generic
top level.
Fixes a couple of crashers.
2016-12-05 19:34:02 -08:00
swift-ci
5b822979a1
Merge pull request #6088 from bitjammer/correct-utf-8-illegal-octets
2016-12-05 17:51:10 -08:00
swift-ci
de858041e7
Merge pull request #6087 from akyrtzi/fix-ide-crash-084
2016-12-05 17:51:09 -08:00
David Farler
330c2d96e6
Make the lexer UTF-8 RFC 3629 correct re: prefix octets
...
RFC 2279 states that, in UTF-8:
"The octet values FE and FF never appear."
RFC 3629 states that, in UTF-8:
"The octet values C0, C1, F5 to FF never appear."
Generalize the check to advance past invalid starting bytes for
a UTF-8 sequence to fix a crash in the lexer.
2016-12-05 17:21:17 -08:00
Argyrios Kyrtzidis
fc678740db
[code-completion] Avoid a tentantive parse when in code-completion mode and make sure CodeCompletionExpr has a token range.
...
The tentantive parse is used for diagnostic purposes but can cause code-completion to delay the same decl twice.
The range of CodeCompletionExpr was previously character range which invalidated invariants of the AST.
Fixes:
validation-test/IDE/crashers_fixed/084-swift-parser-consumedecl.swift
validation-test/IDE/crashers_fixed/104-swift-gettypeofcompletioncontextexpr.swift
2016-12-05 17:09:49 -08:00
Nathan Hawes
528f38aadb
[code-completion] Fix crash in printParameterList when paramListTy is Error type rdar://problem/28867801
2016-12-05 15:16:13 -08:00
swift-ci
9fc23c026b
Merge pull request #6082 from akyrtzi/fix-ide-crash-074
2016-12-05 14:58:42 -08:00
Argyrios Kyrtzidis
b0705b455a
[code-completion] Fix assertion hit when calling 'DeclContext::getResilienceExpansion()' with invalid code
...
Fixes:
validation-test/IDE/crashers/074-swift-valuedecl-geteffectiveaccess.swift
validation-test/IDE/crashers/095-swift-declcontext-getresilienceexpansion.swift
2016-12-05 14:39:53 -08:00
swift-ci
af93a40a6b
Merge pull request #6081 from practicalswift/swiftc-28559-result-case-not-implemented
2016-12-05 14:24:28 -08:00
swift-ci
796994cd80
Merge pull request #6080 from akyrtzi/fix-crash-014
2016-12-05 13:30:31 -08:00
practicalswift
a317c6ac02
[swiftc (136 vs. 5234)] Add crasher in swift::TypeBase::getCanonicalType(...)
...
Add test case for crash triggered in `swift::TypeBase::getCanonicalType(...)`.
Current number of unresolved compiler crashers: 136 (5234 resolved)
/cc @lattner - just wanted to let you know that this crasher caused an assertion failure for the assertion `Result && "Case not implemented!"` added on 2011-03-22 by you in commit fd2bf74f :-)
Assertion failure in [`lib/AST/Type.cpp (line 1312)`](https://github.com/apple/swift/blob/master/lib/AST/Type.cpp#L1312 ):
```
Assertion `Result && "Case not implemented!"' failed.
When executing: swift::CanType swift::TypeBase::getCanonicalType()
```
Assertion context:
```
}
llvm_unreachable("Unknown type kind");
}
TypeBase *ParenType::getSinglyDesugaredType() {
return getUnderlyingType().getPointer();
}
TypeBase *NameAliasType::getSinglyDesugaredType() {
auto *TAD = getDecl();
```
Stack trace:
```
0 0x000000000348edb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x348edb8)
1 0x000000000348f4f6 SignalHandler(int) (/path/to/swift/bin/swift+0x348f4f6)
2 0x00007f495fcb53e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f495e3e3428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f495e3e502a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f495e3dbbd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f495e3dbc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000e33779 swift::TypeBase::getCanonicalType() (/path/to/swift/bin/swift+0xe33779)
8 0x0000000000d33ad0 (anonymous namespace)::FindCapturedVars::checkType(swift::Type, swift::SourceLoc) (/path/to/swift/bin/swift+0xd33ad0)
9 0x0000000000d33f3a (anonymous namespace)::FindCapturedVars::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0xd33f3a)
10 0x0000000000dbcea5 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xdbcea5)
11 0x0000000000dbeee5 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xdbeee5)
12 0x0000000000dbeac0 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xdbeac0)
13 0x0000000000dbb53e swift::Stmt::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdbb53e)
14 0x0000000000d32c64 swift::TypeChecker::computeCaptures(swift::AnyFunctionRef) (/path/to/swift/bin/swift+0xd32c64)
15 0x0000000000d355a7 (anonymous namespace)::FindCapturedVars::propagateCaptures(swift::AnyFunctionRef, swift::SourceLoc) (/path/to/swift/bin/swift+0xd355a7)
16 0x0000000000d3432a (anonymous namespace)::FindCapturedVars::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0xd3432a)
17 0x0000000000dbe9c9 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xdbe9c9)
18 0x0000000000dbb53e swift::Stmt::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdbb53e)
19 0x0000000000d32c64 swift::TypeChecker::computeCaptures(swift::AnyFunctionRef) (/path/to/swift/bin/swift+0xd32c64)
20 0x0000000000c5fdeb typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) (/path/to/swift/bin/swift+0xc5fdeb)
21 0x0000000000c604f9 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc604f9)
22 0x00000000009808a6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x9808a6)
23 0x000000000047d3e6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47d3e6)
24 0x000000000047c2ec swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c2ec)
25 0x000000000043ac17 main (/path/to/swift/bin/swift+0x43ac17)
26 0x00007f495e3ce830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
27 0x0000000000438059 _start (/path/to/swift/bin/swift+0x438059)
```
2016-12-05 22:00:20 +01:00
Argyrios Kyrtzidis
f548c2ba52
[code-completion] Fix assertion hit when completing after incomplete property.
...
Make sure to call getPtrOrNull() instead of get() directly.
2016-12-05 12:48:48 -08:00
swift-ci
159a1d93a2
Merge pull request #6077 from nkcsgexi/ide-crash-012
2016-12-05 12:29:03 -08:00
swift-ci
c14391de1f
Merge pull request #6076 from benlangmuir/fix-040
2016-12-05 12:16:08 -08:00
Xi Ge
5699b5a1e0
Fixing /IDE/crashers/012-swift-mangle-mangler-manglecontext.swift
2016-12-05 11:55:21 -08:00
Ben Langmuir
1ca799bfda
[code-completion] Fix crash in typeCheckConstructorBodyUntil with null nominal context
...
With erroneous code, such as in code-completion, it's not safe to assume
that the constructor is inside a nominal decl context.
rdar://problem/28867794
2016-12-05 11:52:18 -08:00
swift-ci
081ae7126f
Merge pull request #6074 from benlangmuir/fix-008
2016-12-05 11:35:49 -08:00
Ben Langmuir
9894eeda45
[code-completion] Fix crash with missing func body in type-checking
...
We already fail early on a missing body in normal type-checking, but we
missed the case where we call typeCheckAbstractFunctionBodyUntil
directly, as in code-completion.
rdar://problem/28822204
2016-12-05 10:42:56 -08:00
Janek Spaderna
3a95673aa3
[Sema] Don't crash on @IBDesignable extensions wit no type
2016-12-05 18:33:54 +01:00
Greg Parker
09578ca9b0
Test: Disable compiler_crashes/28555... because it only crashes intermittently.
2016-12-05 02:10:20 -08:00
practicalswift
c20f2fe022
[swiftc (136 vs. 5233)] Add crasher in swift::ProtocolConformance::getTypeWitnessSubstAndDecl
...
Add test case for crash triggered in `swift::ProtocolConformance::getTypeWitnessSubstAndDecl`.
Current number of unresolved compiler crashers: 136 (5233 resolved)
Assertion failure in [`lib/AST/ProtocolConformance.cpp (line 298)`](https://github.com/apple/swift/blob/master/lib/AST/ProtocolConformance.cpp#L298 ):
```
Assertion `known != TypeWitnesses.end() && "Didn't resolve witness?"' failed.
When executing: std::pair<const Substitution &, TypeDecl *> swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl *, swift::LazyResolver *) const
```
Assertion context:
```
auto known = TypeWitnesses.find(assocType);
if (known == TypeWitnesses.end()) {
assert(resolver && "Unable to resolve type witness");
resolver->resolveTypeWitness(this, assocType);
known = TypeWitnesses.find(assocType);
assert(known != TypeWitnesses.end() && "Didn't resolve witness?");
}
return known->second;
}
```
Stack trace:
```
0 0x000000000348edb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x348edb8)
1 0x000000000348f4f6 SignalHandler(int) (/path/to/swift/bin/swift+0x348f4f6)
2 0x00007f48ce8d53e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f48cd003428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f48cd00502a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f48ccffbbd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f48ccffbc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000e2a6e7 (/path/to/swift/bin/swift+0xe2a6e7)
8 0x0000000000e2a506 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const (/path/to/swift/bin/swift+0xe2a506)
9 0x0000000000c1c4a4 (anonymous namespace)::LookupResultBuilder::add(swift::ValueDecl*, swift::ValueDecl*, swift::Type) (/path/to/swift/bin/swift+0xc1c4a4)
10 0x0000000000c1c034 swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) (/path/to/swift/bin/swift+0xc1c034)
11 0x0000000000bd391f swift::TypeChecker::resolveDeclRefExpr(swift::UnresolvedDeclRefExpr*, swift::DeclContext*) (/path/to/swift/bin/swift+0xbd391f)
12 0x0000000000be00bf (anonymous namespace)::PreCheckExpression::walkToExprPre(swift::Expr*) (/path/to/swift/bin/swift+0xbe00bf)
13 0x0000000000dbb48b swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdbb48b)
14 0x0000000000bd52c5 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>) (/path/to/swift/bin/swift+0xbd52c5)
15 0x0000000000bd89a9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0xbd89a9)
16 0x0000000000bdc786 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) (/path/to/swift/bin/swift+0xbdc786)
17 0x0000000000bdc93f swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) (/path/to/swift/bin/swift+0xbdc93f)
18 0x0000000000bf21bc validatePatternBindingDecl(swift::TypeChecker&, swift::PatternBindingDecl*, unsigned int) (/path/to/swift/bin/swift+0xbf21bc)
19 0x0000000000bee27d (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbee27d)
20 0x0000000000bfbfcb (anonymous namespace)::DeclChecker::visitEnumDecl(swift::EnumDecl*) (/path/to/swift/bin/swift+0xbfbfcb)
21 0x0000000000bee23b (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbee23b)
22 0x0000000000bfd06b (anonymous namespace)::DeclChecker::visitProtocolDecl(swift::ProtocolDecl*) (/path/to/swift/bin/swift+0xbfd06b)
23 0x0000000000bee31a (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbee31a)
24 0x0000000000bee14d swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xbee14d)
25 0x0000000000c603f2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc603f2)
26 0x00000000009808a6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x9808a6)
27 0x000000000047d3e6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47d3e6)
28 0x000000000047c2ec swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c2ec)
29 0x000000000043ac17 main (/path/to/swift/bin/swift+0x43ac17)
30 0x00007f48ccfee830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
31 0x0000000000438059 _start (/path/to/swift/bin/swift+0x438059)
```
2016-12-04 21:21:07 +01:00
practicalswift
b065600d1a
[swiftc (135 vs. 5233)] Add crasher in swift::ASTVisitor
...
Add test case for crash triggered in `swift::ASTVisitor`.
Current number of unresolved compiler crashers: 135 (5233 resolved)
Stack trace:
```
0 0x000000000348edb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x348edb8)
1 0x000000000348f4f6 SignalHandler(int) (/path/to/swift/bin/swift+0x348f4f6)
2 0x00007fdc23d2a3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x0000000000d7abf4 swift::ASTVisitor<(anonymous namespace)::PrintTypeRepr, void, void, void, void, void, void>::visit(swift::TypeRepr*) (/path/to/swift/bin/swift+0xd7abf4)
4 0x0000000000d8377a (anonymous namespace)::PrintTypeRepr::printRec(swift::TypeRepr*) (/path/to/swift/bin/swift+0xd8377a)
5 0x0000000000d839e5 (anonymous namespace)::PrintTypeRepr::visitIdentTypeRepr(swift::IdentTypeRepr*) (/path/to/swift/bin/swift+0xd839e5)
6 0x0000000000d81e2b (anonymous namespace)::PrintDecl::printAbstractFunctionDecl(swift::AbstractFunctionDecl*) (/path/to/swift/bin/swift+0xd81e2b)
7 0x0000000000d73923 swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) (/path/to/swift/bin/swift+0xd73923)
8 0x0000000000d7f60a (anonymous namespace)::PrintDecl::printRec(swift::Decl*) (/path/to/swift/bin/swift+0xd7f60a)
9 0x0000000000d81100 (anonymous namespace)::PrintDecl::printAccessors(swift::AbstractStorageDecl*) (/path/to/swift/bin/swift+0xd81100)
10 0x0000000000d733bd swift::ASTVisitor<(anonymous namespace)::PrintDecl, void, void, void, void, void, void>::visit(swift::Decl*) (/path/to/swift/bin/swift+0xd733bd)
11 0x0000000000d71974 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const (/path/to/swift/bin/swift+0xd71974)
12 0x0000000000d821eb (anonymous namespace)::PrintStmt::printASTNodes(llvm::ArrayRef<swift::ASTNode> const&, llvm::StringRef) (/path/to/swift/bin/swift+0xd821eb)
13 0x0000000000d75f92 swift::ASTVisitor<(anonymous namespace)::PrintStmt, void, void, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xd75f92)
14 0x0000000000d752cd swift::Stmt::print(llvm::raw_ostream&, unsigned int) const (/path/to/swift/bin/swift+0xd752cd)
15 0x0000000000daceb8 (anonymous namespace)::Verifier::walkToStmtPost(swift::Stmt*) (/path/to/swift/bin/swift+0xdaceb8)
16 0x0000000000dbeae2 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xdbeae2)
17 0x0000000000dbbb44 (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0xdbbb44)
18 0x0000000000dbb8d4 swift::Decl::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdbb8d4)
19 0x0000000000e137ae swift::SourceFile::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xe137ae)
20 0x0000000000da49e5 swift::verify(swift::SourceFile&) (/path/to/swift/bin/swift+0xda49e5)
21 0x0000000000b54ab1 swift::Parser::parseTopLevel() (/path/to/swift/bin/swift+0xb54ab1)
22 0x0000000000b88b90 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) (/path/to/swift/bin/swift+0xb88b90)
23 0x0000000000980883 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x980883)
24 0x000000000047d3e6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47d3e6)
25 0x000000000047c2ec swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c2ec)
26 0x000000000043ac17 main (/path/to/swift/bin/swift+0x43ac17)
27 0x00007fdc22443830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
28 0x0000000000438059 _start (/path/to/swift/bin/swift+0x438059)
```
2016-12-04 20:20:18 +01:00
practicalswift
144b03eaba
[swiftc (134 vs. 5233)] Add crasher in swift::ASTVisitor
...
Add test case for crash triggered in `swift::ASTVisitor`.
Current number of unresolved compiler crashers: 134 (5233 resolved)
Assertion failure in `llvm/include/llvm/Support/Casting.h (line 95)`:
```
Assertion `Val && "isa<> used on a null pointer"' failed.
When executing: static bool llvm::isa_impl_cl<swift::ClassDecl, const swift::NominalTypeDecl *>::doit(const From *) [To = swift::ClassDecl, From = const swift::NominalTypeDecl *]
```
Assertion context:
```
}
};
template <typename To, typename From> struct isa_impl_cl<To, const From*> {
static inline bool doit(const From *Val) {
assert(Val && "isa<> used on a null pointer");
return isa_impl<To, From>::doit(*Val);
}
};
template <typename To, typename From> struct isa_impl_cl<To, const From*const> {
```
Stack trace:
```
0 0x000000000348edb8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x348edb8)
1 0x000000000348f4f6 SignalHandler(int) (/path/to/swift/bin/swift+0x348f4f6)
2 0x00007fda86a483e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007fda85176428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007fda8517802a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007fda8516ebd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007fda8516ec82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000d2d5b4 swift::ASTVisitor<(anonymous namespace)::AttributeEarlyChecker, void, void, void, void, void, void>::visit(swift::DeclAttribute*) (/path/to/swift/bin/swift+0xd2d5b4)
8 0x0000000000d2b44c swift::TypeChecker::checkDeclAttributesEarly(swift::Decl*) (/path/to/swift/bin/swift+0xd2b44c)
9 0x0000000000bfb687 (anonymous namespace)::DeclChecker::visitExtensionDecl(swift::ExtensionDecl*) (/path/to/swift/bin/swift+0xbfb687)
10 0x0000000000bee1db (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbee1db)
11 0x0000000000bee14d swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xbee14d)
12 0x0000000000c603f2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc603f2)
13 0x00000000009808a6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x9808a6)
14 0x000000000047d3e6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47d3e6)
15 0x000000000047c2ec swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c2ec)
16 0x000000000043ac17 main (/path/to/swift/bin/swift+0x43ac17)
17 0x00007fda85161830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
18 0x0000000000438059 _start (/path/to/swift/bin/swift+0x438059)
```
2016-12-04 18:31:22 +01:00
practicalswift
2a3ebfb307
[swiftc (136 vs. 5230)] Add crasher in swift::Type::findIf
...
Add test case for crash triggered in `swift::Type::findIf`.
Current number of unresolved compiler crashers: 136 (5230 resolved)
Stack trace:
```
0 0x00000000033f9978 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33f9978)
1 0x00000000033fa0b6 SignalHandler(int) (/path/to/swift/bin/swift+0x33fa0b6)
2 0x00007fc62863d3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007fc626d6b428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007fc626d6d02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x000000000339705d llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (/path/to/swift/bin/swift+0x339705d)
6 0x0000000000e3687f (/path/to/swift/bin/swift+0xe3687f)
7 0x0000000000daf5f1 bool llvm::function_ref<bool (swift::Type)>::callback_fn<(anonymous namespace)::Verifier::verifyChecked(swift::Type, llvm::SmallPtrSet<swift::ArchetypeType*, 4u>&)::{lambda(swift::Type)#1}>(long, swift::Type) (/path/to/swift/bin/swift+0xdaf5f1)
8 0x0000000000e3ec3b swift::Type::findIf(llvm::function_ref<bool (swift::Type)>) const::Walker::walkToTypePre(swift::Type) (/path/to/swift/bin/swift+0xe3ec3b)
9 0x0000000000e465c5 swift::Type::walk(swift::TypeWalker&) const (/path/to/swift/bin/swift+0xe465c5)
10 0x0000000000e33512 swift::Type::findIf(llvm::function_ref<bool (swift::Type)>) const (/path/to/swift/bin/swift+0xe33512)
11 0x0000000000daf562 (anonymous namespace)::Verifier::verifyChecked(swift::Type, llvm::SmallPtrSet<swift::ArchetypeType*, 4u>&) (/path/to/swift/bin/swift+0xdaf562)
12 0x0000000000db7dd4 (anonymous namespace)::Verifier::verifyCheckedAlways(swift::ValueDecl*) (/path/to/swift/bin/swift+0xdb7dd4)
13 0x0000000000dacc3b (anonymous namespace)::Verifier::walkToDeclPost(swift::Decl*) (/path/to/swift/bin/swift+0xdacc3b)
14 0x0000000000dbad8e (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0xdbad8e)
15 0x0000000000dbd2ce (anonymous namespace)::Traversal::visitParameterList(swift::ParameterList*) (/path/to/swift/bin/swift+0xdbd2ce)
16 0x0000000000dbafa6 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xdbafa6)
17 0x0000000000dbd4ce (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0xdbd4ce)
18 0x0000000000dbd227 (anonymous namespace)::Traversal::visitCollectionExpr(swift::CollectionExpr*) (/path/to/swift/bin/swift+0xdbd227)
19 0x0000000000dbbd69 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xdbbd69)
20 0x0000000000dbd4ce (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0xdbd4ce)
21 0x0000000000dbd7e4 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xdbd7e4)
22 0x0000000000dba934 (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0xdba934)
23 0x0000000000dba6c4 swift::Decl::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdba6c4)
24 0x0000000000e1259e swift::SourceFile::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xe1259e)
25 0x0000000000da37d5 swift::verify(swift::SourceFile&) (/path/to/swift/bin/swift+0xda37d5)
26 0x0000000000c5f3a9 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc5f3a9)
27 0x000000000097f696 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x97f696)
28 0x000000000047c1d6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1d6)
29 0x000000000047b0dc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0dc)
30 0x0000000000439a07 main (/path/to/swift/bin/swift+0x439a07)
31 0x00007fc626d56830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
32 0x0000000000436e49 _start (/path/to/swift/bin/swift+0x436e49)
```
2016-12-04 17:51:45 +01:00
Slava Pestov
1a991da16d
AST: Assign interface types to ParamDecls
...
First, ensure all ParamDecls that are synthesized from scratch are given
both a contextual type and an interface type.
For ParamDecls written in source, add a new recordParamType() method to
GenericTypeResolver. This calls setType() or setInterfaceType() as
appropriate.
Interestingly enough a handful of diagnostics in the test suite have
improved. I'm not sure why, but I'll take it.
The ParamDecl::createUnboundSelf() method is now only used in the parser,
and no longer sets the type of the self parameter to the unbound generic
type. This was wrong anyway, since the type was always being overwritten.
This allows us to remove DeclContext::getSelfTypeOfContext().
Also, ensure that FuncDecl::getBodyResultTypeLoc() always has an interface
type for synthesized declarations, eliminating a mapTypeOutOfContext()
call when computing the function interface type in configureInterfaceType().
Finally, clean up the logic for resolving the DynamicSelfType. We now
get the interface or contextual type of 'Self' via the resolver, instead
of always getting the contextual type and patching it up inside
configureInterfaceType().
2016-12-04 00:02:21 -08:00
Pavel Yaskevich
91e8a0ccdb
[QoI] When adding archetype requirements don't expect all of the members to be resolved
...
Some of the type members might be unresolved because they are misspelled or
do not exist (represented by DependentMemberType), so when trying to add
requirements to the nested types don't expect that all of the members have
their associated types resolved.
Resolves: <rdar://problem/28235248>.
2016-12-03 23:19:51 -08:00
practicalswift
1138433a13
[swiftc (135 vs. 5230)] Add crasher in swift::constraints::ConstraintSystem::resolveOverload
...
Add test case for crash triggered in `swift::constraints::ConstraintSystem::resolveOverload`.
Current number of unresolved compiler crashers: 135 (5230 resolved)
Assertion failure in [`lib/Sema/ConstraintSystem.cpp (line 1425)`](https://github.com/apple/swift/blob/master/lib/Sema/ConstraintSystem.cpp#L1425 ):
```
Assertion `!refType->hasTypeParameter() && "Cannot have a dependent type here"' failed.
When executing: void swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator *, swift::Type, swift::constraints::OverloadChoice)
```
Assertion context:
```
refType = tuple->getElementType(choice.getTupleIndex())->getRValueType();
}
break;
}
assert(!refType->hasTypeParameter() && "Cannot have a dependent type here");
// If we're binding to an init member, the 'throws' need to line up between
// the bound and reference types.
if (choice.isDecl()) {
auto decl = choice.getDecl();
```
Stack trace:
```
0 0x00000000033f9978 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33f9978)
1 0x00000000033fa0b6 SignalHandler(int) (/path/to/swift/bin/swift+0x33fa0b6)
2 0x00007f28bc7a63e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f28baed4428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f28baed602a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f28baeccbd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f28baeccc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000d08fb0 swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) (/path/to/swift/bin/swift+0xd08fb0)
8 0x0000000000d07ec7 swift::constraints::ConstraintSystem::addOverloadSet(swift::Type, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocator*, swift::constraints::OverloadChoice*) (/path/to/swift/bin/swift+0xd07ec7)
9 0x0000000000cd3e8f swift::constraints::ConstraintSystem::simplifyMemberConstraint(swift::constraints::ConstraintKind, swift::Type, swift::DeclName, swift::Type, swift::FunctionRefKind, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) (/path/to/swift/bin/swift+0xcd3e8f)
10 0x0000000000cbecf2 swift::constraints::ConstraintSystem::addValueMemberConstraint(swift::Type, swift::DeclName, swift::Type, swift::FunctionRefKind, swift::constraints::ConstraintLocatorBuilder) (/path/to/swift/bin/swift+0xcbecf2)
11 0x0000000000cb55a3 swift::ASTVisitor<(anonymous namespace)::ConstraintGenerator, swift::Type, void, void, void, void, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xcb55a3)
12 0x0000000000cbbcff (anonymous namespace)::ConstraintWalker::walkToExprPost(swift::Expr*) (/path/to/swift/bin/swift+0xcbbcff)
13 0x0000000000dbd47c (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0xdbd47c)
14 0x0000000000dbc03c swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xdbc03c)
15 0x0000000000dba2ab swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdba2ab)
16 0x0000000000cb37c8 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*) (/path/to/swift/bin/swift+0xcb37c8)
17 0x0000000000cde5ad swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) (/path/to/swift/bin/swift+0xcde5ad)
18 0x0000000000bd4174 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>) (/path/to/swift/bin/swift+0xbd4174)
19 0x0000000000bd7799 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0xbd7799)
20 0x0000000000c4b40e swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xc4b40e)
21 0x0000000000c49c32 swift::TypeChecker::typeCheckConstructorBodyUntil(swift::ConstructorDecl*, swift::SourceLoc) (/path/to/swift/bin/swift+0xc49c32)
22 0x0000000000c495f7 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) (/path/to/swift/bin/swift+0xc495f7)
23 0x0000000000c4a341 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) (/path/to/swift/bin/swift+0xc4a341)
24 0x0000000000c5e727 typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) (/path/to/swift/bin/swift+0xc5e727)
25 0x0000000000c5f2e9 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc5f2e9)
26 0x000000000097f696 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x97f696)
27 0x000000000047c1d6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1d6)
28 0x000000000047b0dc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0dc)
29 0x0000000000439a07 main (/path/to/swift/bin/swift+0x439a07)
30 0x00007f28baebf830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
31 0x0000000000436e49 _start (/path/to/swift/bin/swift+0x436e49)
```
2016-12-03 22:29:25 +01:00
practicalswift
df02bd792b
[swiftc (134 vs. 5230)] Add crasher in swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl
...
Add test case for crash triggered in `swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl`.
Current number of unresolved compiler crashers: 134 (5230 resolved)
Assertion failure in [`lib/AST/ProtocolConformance.cpp (line 295)`](https://github.com/apple/swift/blob/master/lib/AST/ProtocolConformance.cpp#L295 ):
```
Assertion `resolver && "Unable to resolve type witness"' failed.
When executing: std::pair<const Substitution &, TypeDecl *> swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl *, swift::LazyResolver *) const
```
Assertion context:
```
if (Resolver)
resolveLazyInfo();
auto known = TypeWitnesses.find(assocType);
if (known == TypeWitnesses.end()) {
assert(resolver && "Unable to resolve type witness");
resolver->resolveTypeWitness(this, assocType);
known = TypeWitnesses.find(assocType);
assert(known != TypeWitnesses.end() && "Didn't resolve witness?");
}
```
Stack trace:
```
0 0x00000000033f9978 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33f9978)
1 0x00000000033fa0b6 SignalHandler(int) (/path/to/swift/bin/swift+0x33fa0b6)
2 0x00007fa697cf83e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007fa696426428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007fa69642802a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007fa69641ebd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007fa69641ec82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000e294b8 swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const (/path/to/swift/bin/swift+0xe294b8)
8 0x0000000000c437e4 diagnoseMatch(swift::TypeChecker&, swift::ModuleDecl*, swift::NormalProtocolConformance*, swift::ValueDecl*, (anonymous namespace)::RequirementMatch const&) (/path/to/swift/bin/swift+0xc437e4)
9 0x0000000000c435da std::_Function_handler<void (swift::TypeChecker&, swift::NormalProtocolConformance*), (anonymous namespace)::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*)::$_20>::_M_invoke(std::_Any_data const&, swift::TypeChecker&, swift::NormalProtocolConformance*&&) (/path/to/swift/bin/swift+0xc435da)
10 0x0000000000c2aea4 (anonymous namespace)::ConformanceChecker::diagnoseOrDefer(swift::ValueDecl*, bool, std::function<void (swift::TypeChecker&, swift::NormalProtocolConformance*)>) (/path/to/swift/bin/swift+0xc2aea4)
11 0x0000000000c2dc74 (anonymous namespace)::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*) (/path/to/swift/bin/swift+0xc2dc74)
12 0x0000000000c25f41 swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) (/path/to/swift/bin/swift+0xc25f41)
13 0x0000000000c26475 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) (/path/to/swift/bin/swift+0xc26475)
14 0x0000000000bfaf0d (anonymous namespace)::DeclChecker::visitStructDecl(swift::StructDecl*) (/path/to/swift/bin/swift+0xbfaf0d)
15 0x0000000000bed12a (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbed12a)
16 0x0000000000becf3d swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xbecf3d)
17 0x0000000000c5f26a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc5f26a)
18 0x000000000097f696 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x97f696)
19 0x000000000047c1d6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1d6)
20 0x000000000047b0dc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0dc)
21 0x0000000000439a07 main (/path/to/swift/bin/swift+0x439a07)
22 0x00007fa696411830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
23 0x0000000000436e49 _start (/path/to/swift/bin/swift+0x436e49)
```
2016-12-03 21:59:44 +01:00
practicalswift
854e19e1a6
[swiftc (133 vs. 5230)] Add crasher in swift::TypeChecker::foldSequence
...
Add test case for crash triggered in `swift::TypeChecker::foldSequence`.
Current number of unresolved compiler crashers: 133 (5230 resolved)
Assertion failure in [`lib/Sema/TypeCheckExpr.cpp (line 309)`](https://github.com/apple/swift/blob/master/lib/Sema/TypeCheckExpr.cpp#L309 ):
```
Assertion `!as->isFolded() && "already folded 'as' expr in sequence?!"' failed.
When executing: swift::Expr *makeBinOp(swift::TypeChecker &, swift::Expr *, swift::Expr *, swift::Expr *, swift::PrecedenceGroupDecl *, bool)
```
Assertion context:
```
return makeResultExpr(assign);
}
if (auto *as = dyn_cast<ExplicitCastExpr>(Op)) {
// Resolve the 'as' or 'is' expression.
assert(!as->isFolded() && "already folded 'as' expr in sequence?!");
assert(RHS == as && "'as' with non-type RHS?!");
as->setSubExpr(LHS);
return makeResultExpr(as);
}
```
Stack trace:
```
0 0x00000000033f9978 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33f9978)
1 0x00000000033fa0b6 SignalHandler(int) (/path/to/swift/bin/swift+0x33fa0b6)
2 0x00007f9b0be563e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f9b0a584428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f9b0a58602a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f9b0a57cbd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f9b0a57cc82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000c15442 makeBinOp(swift::TypeChecker&, swift::Expr*, swift::Expr*, swift::Expr*, swift::PrecedenceGroupDecl*, bool) (/path/to/swift/bin/swift+0xc15442)
8 0x0000000000c14838 swift::TypeChecker::foldSequence(swift::SequenceExpr*, swift::DeclContext*) (/path/to/swift/bin/swift+0xc14838)
9 0x0000000000bdf103 (anonymous namespace)::PreCheckExpression::walkToExprPost(swift::Expr*) (/path/to/swift/bin/swift+0xbdf103)
10 0x0000000000dba2cc swift::Expr::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdba2cc)
11 0x0000000000bd40b5 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>) (/path/to/swift/bin/swift+0xbd40b5)
12 0x0000000000bd7799 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0xbd7799)
13 0x0000000000bdb87d swift::TypeChecker::typeCheckForEachBinding(swift::DeclContext*, swift::ForEachStmt*) (/path/to/swift/bin/swift+0xbdb87d)
14 0x0000000000c4c0b5 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xc4c0b5)
15 0x0000000000c4b33d swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xc4b33d)
16 0x0000000000c4aa8b swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) (/path/to/swift/bin/swift+0xc4aa8b)
17 0x0000000000c693cc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) (/path/to/swift/bin/swift+0xc693cc)
18 0x0000000000bd782a swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) (/path/to/swift/bin/swift+0xbd782a)
19 0x0000000000bdb576 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) (/path/to/swift/bin/swift+0xbdb576)
20 0x0000000000bdb72f swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) (/path/to/swift/bin/swift+0xbdb72f)
21 0x0000000000bed0e4 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbed0e4)
22 0x0000000000becf3d swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xbecf3d)
23 0x0000000000c4b3b4 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xc4b3b4)
24 0x0000000000c49793 swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) (/path/to/swift/bin/swift+0xc49793)
25 0x0000000000c495f0 swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*, swift::SourceLoc) (/path/to/swift/bin/swift+0xc495f0)
26 0x0000000000c4a341 swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) (/path/to/swift/bin/swift+0xc4a341)
27 0x0000000000c5e727 typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) (/path/to/swift/bin/swift+0xc5e727)
28 0x0000000000c5f2e9 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc5f2e9)
29 0x000000000097f696 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x97f696)
30 0x000000000047c1d6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1d6)
31 0x000000000047b0dc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0dc)
32 0x0000000000439a07 main (/path/to/swift/bin/swift+0x439a07)
33 0x00007f9b0a56f830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
34 0x0000000000436e49 _start (/path/to/swift/bin/swift+0x436e49)
```
2016-12-03 15:56:22 +01:00
practicalswift
10d79bb983
[swiftc (132 vs. 5230)] Add crasher in swift::ASTVisitor
...
Add test case for crash triggered in `swift::ASTVisitor`.
Current number of unresolved compiler crashers: 132 (5230 resolved)
Stack trace:
```
))#0 0x00000000033f9978 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33f9978)
1 0x00000000033fa0b6 SignalHandler(int) (/path/to/swift/bin/swift+0x33fa0b6)
2 0x00007f8c52bab3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f8c512d9428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f8c512db02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x0000000000dabcad (anonymous namespace)::Verifier::walkToStmtPost(swift::Stmt*) (/path/to/swift/bin/swift+0xdabcad)
6 0x0000000000dbd8d2 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xdbd8d2)
7 0x0000000000dba934 (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0xdba934)
8 0x0000000000dba6c4 swift::Decl::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdba6c4)
9 0x0000000000e1259e swift::SourceFile::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xe1259e)
10 0x0000000000da37d5 swift::verify(swift::SourceFile&) (/path/to/swift/bin/swift+0xda37d5)
11 0x0000000000b538a1 swift::Parser::parseTopLevel() (/path/to/swift/bin/swift+0xb538a1)
12 0x0000000000b87980 swift::parseIntoSourceFile(swift::SourceFile&, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) (/path/to/swift/bin/swift+0xb87980)
13 0x000000000097f673 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x97f673)
14 0x000000000047c1d6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1d6)
15 0x000000000047b0dc swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0dc)
16 0x0000000000439a07 main (/path/to/swift/bin/swift+0x439a07)
17 0x00007f8c512c4830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
18 0x0000000000436e49 _start (/path/to/swift/bin/swift+0x436e49)
```
2016-12-03 05:47:30 +01:00
Doug Gregor
c98295357c
[Archetype builder] Simplify handling of typealiases in protocols.
...
PotentialArchetype::getNestedType() was effectively reimplementing a
simplified form of mapTypeOutOfContext(), missing some cases in the
process. Just use mapTypeOutOfContext() and resolveArchetype(). While
here, stop re-implementing the addSameType* operations; just call them
directly. With these changes, we no longer need the "typealias in
protocol is too complex" diagnostic.
Eliminates another use of getSelfTypeInContext().
2016-12-02 15:31:04 -08:00
Joe Groff
277608a69b
Print and parse SILBoxTypes with a new syntax.
...
Use a syntax that declares the layout's generic parameters and fields,
followed by the generic arguments to apply to the layout:
{ var Int, let String } // A concrete box layout with a mutable Int
// and immutable String field
<T, U> { var T, let U } <Int, String> // A generic box layout,
// applied to Int and String
// arguments
2016-12-02 13:44:22 -08:00
practicalswift
62fc6e71ed
[swiftc (133 vs. 5228)] Add crasher in swift::Type::findIf
...
Add test case for crash triggered in `swift::Type::findIf`.
Current number of unresolved compiler crashers: 133 (5228 resolved)
Stack trace:
```
0 0x00000000033b8068 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33b8068)
1 0x00000000033b87a6 SignalHandler(int) (/path/to/swift/bin/swift+0x33b87a6)
2 0x00007f4cc8f263e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f4cc7654428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f4cc765602a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00000000033550ed llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) (/path/to/swift/bin/swift+0x33550ed)
6 0x0000000000d933be swift::TypeVisitor<(anonymous namespace)::TypePrinter, void>::visit(swift::Type) (/path/to/swift/bin/swift+0xd933be)
7 0x0000000000d81884 (anonymous namespace)::TypePrinter::visit(swift::Type) (/path/to/swift/bin/swift+0xd81884)
8 0x0000000000d817c1 swift::Type::print(llvm::raw_ostream&, swift::PrintOptions const&) const (/path/to/swift/bin/swift+0xd817c1)
9 0x0000000000d76c55 (anonymous namespace)::PrintDecl::printParameter(swift::ParamDecl const*) (/path/to/swift/bin/swift+0xd76c55)
10 0x0000000000d69ee4 swift::Decl::dump(llvm::raw_ostream&, unsigned int) const (/path/to/swift/bin/swift+0xd69ee4)
11 0x0000000000db100a (anonymous namespace)::Verifier::checkErrors(swift::ValueDecl*) (/path/to/swift/bin/swift+0xdb100a)
12 0x0000000000da5eb7 (anonymous namespace)::Verifier::walkToDeclPost(swift::Decl*) (/path/to/swift/bin/swift+0xda5eb7)
13 0x0000000000db40ae (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0xdb40ae)
14 0x0000000000db65ee (anonymous namespace)::Traversal::visitParameterList(swift::ParameterList*) (/path/to/swift/bin/swift+0xdb65ee)
15 0x0000000000db42c6 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xdb42c6)
16 0x0000000000db41e0 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xdb41e0)
17 0x0000000000db67ee (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0xdb67ee)
18 0x0000000000db6547 (anonymous namespace)::Traversal::visitCollectionExpr(swift::CollectionExpr*) (/path/to/swift/bin/swift+0xdb6547)
19 0x0000000000db5089 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) (/path/to/swift/bin/swift+0xdb5089)
20 0x0000000000db67ee (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) (/path/to/swift/bin/swift+0xdb67ee)
21 0x0000000000db6b04 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) (/path/to/swift/bin/swift+0xdb6b04)
22 0x0000000000db3c54 (anonymous namespace)::Traversal::doIt(swift::Decl*) (/path/to/swift/bin/swift+0xdb3c54)
23 0x0000000000db39e4 swift::Decl::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xdb39e4)
24 0x0000000000e0ba7e swift::SourceFile::walk(swift::ASTWalker&) (/path/to/swift/bin/swift+0xe0ba7e)
25 0x0000000000d9ca95 swift::verify(swift::SourceFile&) (/path/to/swift/bin/swift+0xd9ca95)
26 0x0000000000c59869 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc59869)
27 0x0000000000979c46 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x979c46)
28 0x000000000047c1e6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1e6)
29 0x000000000047b0ec swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0ec)
30 0x0000000000439a17 main (/path/to/swift/bin/swift+0x439a17)
31 0x00007f4cc763f830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
32 0x0000000000436e59 _start (/path/to/swift/bin/swift+0x436e59)
```
2016-12-02 16:23:37 +01:00
swift-ci
8be4df4bae
Merge pull request #6011 from DougGregor/lazy-nested-types
2016-12-01 21:05:13 -08:00
Doug Gregor
301ef9a689
Mark test as requiring deterministic variable (due to type variables escaping).
2016-12-01 20:27:44 -08:00
Slava Pestov
4ba00a0c06
AST: Remove FuncDecl::getDynamicSelf() and getDynamicSelfInterface()
2016-12-01 20:17:58 -08:00
practicalswift
22b712d30c
[swiftc (135 vs. 5225)] Add crasher in swift::TypeBase::getDesugaredType(...)
...
Add test case for crash triggered in `swift::TypeBase::getDesugaredType(...)`.
Current number of unresolved compiler crashers: 135 (5225 resolved)
Stack trace:
```
0 0x00000000033bb388 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33bb388)
1 0x00000000033bbac6 SignalHandler(int) (/path/to/swift/bin/swift+0x33bbac6)
2 0x00007feea0e393e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x0000000000e33de0 swift::TypeBase::getDesugaredType() (/path/to/swift/bin/swift+0xe33de0)
4 0x0000000000c26712 (anonymous namespace)::RequirementEnvironment::RequirementEnvironment(swift::TypeChecker&, swift::DeclContext*, swift::ValueDecl*, swift::ProtocolConformance*) (/path/to/swift/bin/swift+0xc26712)
5 0x0000000000c2a909 (anonymous namespace)::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*) (/path/to/swift/bin/swift+0xc2a909)
6 0x0000000000c237c1 swift::TypeChecker::checkConformance(swift::NormalProtocolConformance*) (/path/to/swift/bin/swift+0xc237c1)
7 0x0000000000c23cf5 swift::TypeChecker::checkConformancesInContext(swift::DeclContext*, swift::IterableDeclContext*) (/path/to/swift/bin/swift+0xc23cf5)
8 0x0000000000bf8328 (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) (/path/to/swift/bin/swift+0xbf8328)
9 0x0000000000bea19b (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbea19b)
10 0x0000000000bf834b (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) (/path/to/swift/bin/swift+0xbf834b)
11 0x0000000000bea19b (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbea19b)
12 0x0000000000bea0fd swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xbea0fd)
13 0x0000000000c5c75a swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc5c75a)
14 0x000000000097b226 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x97b226)
15 0x000000000047c1e6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1e6)
16 0x000000000047b0ee swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0ee)
17 0x0000000000439a17 main (/path/to/swift/bin/swift+0x439a17)
18 0x00007fee9f552830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
19 0x0000000000436e59 _start (/path/to/swift/bin/swift+0x436e59)
```
2016-12-02 03:19:18 +01:00
practicalswift
0f2f05b032
[swiftc (134 vs. 5225)] Add crasher in swift::ArchetypeBuilder::mapTypeOutOfContext
...
Add test case for crash triggered in `swift::ArchetypeBuilder::mapTypeOutOfContext`.
Current number of unresolved compiler crashers: 134 (5225 resolved)
Assertion failure in [`lib/AST/ArchetypeBuilder.cpp (line 2147)`](https://github.com/apple/swift/blob/master/lib/AST/ArchetypeBuilder.cpp#L2147 ):
```
Assertion `!canType->hasTypeParameter() && "already have an interface type"' failed.
When executing: static swift::Type swift::ArchetypeBuilder::mapTypeOutOfContext(swift::ModuleDecl *, swift::GenericEnvironment *, swift::Type)
```
Assertion context:
```
ArrayRef<GenericTypeParamType *> params,
SmallVectorImpl<Requirement> &requirements) {
builder.enumerateRequirements([&](RequirementKind kind,
ArchetypeBuilder::PotentialArchetype *archetype,
llvm::PointerUnion<Type, ArchetypeBuilder::PotentialArchetype *> type,
RequirementSource source) {
// Filter out redundant requirements.
switch (source.getKind()) {
case RequirementSource::Explicit:
case RequirementSource::Inferred:
// The requirement was explicit and required, keep it.
```
Stack trace:
```
0 0x00000000033bb388 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33bb388)
1 0x00000000033bbac6 SignalHandler(int) (/path/to/swift/bin/swift+0x33bbac6)
2 0x00007f440a74f3e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f4408e7d428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f4408e7f02a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f4408e75bd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f4408e75c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000d42751 swift::ArchetypeBuilder::mapTypeOutOfContext(swift::DeclContext const*, swift::Type) (/path/to/swift/bin/swift+0xd42751)
8 0x0000000000c15647 getResultType(swift::TypeChecker&, swift::FuncDecl*, swift::Type) (/path/to/swift/bin/swift+0xc15647)
9 0x0000000000c14d1b swift::TypeChecker::configureInterfaceType(swift::AbstractFunctionDecl*, swift::GenericSignature*) (/path/to/swift/bin/swift+0xc14d1b)
10 0x0000000000c1472a swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) (/path/to/swift/bin/swift+0xc1472a)
11 0x0000000000bfbaa4 (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl*) (/path/to/swift/bin/swift+0xbfbaa4)
12 0x0000000000bea2fa (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbea2fa)
13 0x0000000000be4570 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) (/path/to/swift/bin/swift+0xbe4570)
14 0x0000000000ce6a22 swift::addTrivialAccessorsToStorage(swift::AbstractStorageDecl*, swift::TypeChecker&) (/path/to/swift/bin/swift+0xce6a22)
15 0x0000000000ce85a0 swift::maybeAddAccessorsToVariable(swift::VarDecl*, swift::TypeChecker&) (/path/to/swift/bin/swift+0xce85a0)
16 0x0000000000be480b swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) (/path/to/swift/bin/swift+0xbe480b)
17 0x0000000000bff289 (anonymous namespace)::DeclChecker::visitBoundVariable(swift::VarDecl*) (/path/to/swift/bin/swift+0xbff289)
18 0x0000000000e2344f swift::Pattern::forEachVariable(std::function<void (swift::VarDecl*)> const&) const (/path/to/swift/bin/swift+0xe2344f)
19 0x0000000000bea392 (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbea392)
20 0x0000000000bf834b (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) (/path/to/swift/bin/swift+0xbf834b)
21 0x0000000000bea19b (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbea19b)
22 0x0000000000bf911b (anonymous namespace)::DeclChecker::visitProtocolDecl(swift::ProtocolDecl*) (/path/to/swift/bin/swift+0xbf911b)
23 0x0000000000bea2ca (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbea2ca)
24 0x0000000000bea0fd swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xbea0fd)
25 0x0000000000c5c6d2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc5c6d2)
26 0x000000000097b226 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x97b226)
27 0x000000000047c1e6 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47c1e6)
28 0x000000000047b0ee swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b0ee)
29 0x0000000000439a17 main (/path/to/swift/bin/swift+0x439a17)
30 0x00007f4408e68830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
31 0x0000000000436e59 _start (/path/to/swift/bin/swift+0x436e59)
```
2016-12-02 02:35:47 +01:00
Doug Gregor
46e6a38e50
Mark three crashers as resolved
2016-12-01 15:25:43 -08:00
Slava Pestov
2ff9994313
Sema: Improve circularity checks
...
The previous patches regressed a test where we used to diagnose
(poorly) a circular associated type, like so:
associatedtype e: e
With the error "inheritance from non-protocol, non-class type 'e'".
This error went away, because we end up not setting the interface
type of the associated type early enough. Instead, we return an
ErrorType from resolveTypeInContext() and diagnose nothing.
With this patch, emit a diagnostic at the point where the ErrorType
first appears.
Also, remove the isRecursive() bit from AssociatedTypeDecl, and
remove isBeingTypeChecked() which duplicates a bit with the same
name in Decl.
2016-12-01 13:00:19 -08:00
Bob Wilson
0f9bd4252e
Merge pull request #5997 from bob-wilson/reenable-test
...
Revert "Disable validation-test/stdlib/UnicodeLongTest.swift for watchOS."
2016-12-01 09:26:58 -08:00
Bob Wilson
b33d4fc84c
Revert "Disable validation-test/stdlib/UnicodeLongTest.swift for watchos."
...
This reverts commit 231fb5e054 .
This test was failing the last time we updated the stable branches
of LLVM/Clang so it was disabled. No one remembers what was the
problem, so try reenabling it to see if anything breaks.
2016-11-30 16:07:17 -08:00
Doug Gregor
589b469484
[AST] Extend a hack to work around broken circular inheritance checking.
...
Extending this hack recovers a regression in a previously-fixed
compiler crasher (#26725 ), and fixes two more compiler crashers. So,
despite it's utter lack of principle, it's progress.
2016-11-30 15:44:14 -08:00
Max Moiseev
3059b3cdd1
Merge branch 'master' into new-integer-protocols
2016-11-30 10:45:10 -08:00
practicalswift
83764ed0d5
[swiftc (137 vs. 5221)] Add crasher in swift::ArchetypeBuilder::addAbstractTypeParamRequirements
...
Add test case for crash triggered in `swift::ArchetypeBuilder::addAbstractTypeParamRequirements`.
Current number of unresolved compiler crashers: 137 (5221 resolved)
Assertion failure in [`lib/AST/ArchetypeBuilder.cpp (line 2061)`](https://github.com/apple/swift/blob/master/lib/AST/ArchetypeBuilder.cpp#L2061 ):
```
Assertion `env && "dependent type in non-generic context"' failed.
When executing: static swift::Type swift::ArchetypeBuilder::mapTypeIntoContext(swift::ModuleDecl *, swift::GenericEnvironment *, swift::Type)
```
Assertion context:
```
}
Type ArchetypeBuilder::mapTypeIntoContext(const DeclContext *dc, Type type) {
return mapTypeIntoContext(dc->getParentModule(),
dc->getGenericEnvironmentOfContext(),
type);
}
Type ArchetypeBuilder::mapTypeIntoContext(ModuleDecl *M,
GenericEnvironment *env,
Type type) {
```
Stack trace:
```
0 0x00000000033b4608 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/path/to/swift/bin/swift+0x33b4608)
1 0x00000000033b4d46 SignalHandler(int) (/path/to/swift/bin/swift+0x33b4d46)
2 0x00007f0c605883e0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x113e0)
3 0x00007f0c5ecb6428 gsignal /build/glibc-Qz8a69/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
4 0x00007f0c5ecb802a abort /build/glibc-Qz8a69/glibc-2.23/stdlib/abort.c:91:0
5 0x00007f0c5ecaebd7 __assert_fail_base /build/glibc-Qz8a69/glibc-2.23/assert/assert.c:92:0
6 0x00007f0c5ecaec82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
7 0x0000000000d3b030 swift::ArchetypeBuilder::addAbstractTypeParamRequirements(swift::AbstractTypeParamDecl*, swift::ArchetypeBuilder::PotentialArchetype*, swift::RequirementSource::Kind, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>&)::$_2::operator()(swift::AssociatedTypeDecl*, swift::ProtocolDecl*, swift::SourceLoc) const (/path/to/swift/bin/swift+0xd3b030)
8 0x0000000000c2aeff (anonymous namespace)::ConformanceChecker::recordTypeWitness(swift::AssociatedTypeDecl*, swift::Type, swift::TypeDecl*, bool) (/path/to/swift/bin/swift+0xc2aeff)
9 0x0000000000c26e47 (anonymous namespace)::ConformanceChecker::resolveTypeWitnesses() (/path/to/swift/bin/swift+0xc26e47)
10 0x0000000000c2491c swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*) (/path/to/swift/bin/swift+0xc2491c)
11 0x0000000000e20def swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const (/path/to/swift/bin/swift+0xe20def)
12 0x0000000000e20cf6 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const (/path/to/swift/bin/swift+0xe20cf6)
13 0x0000000000e215f6 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const (/path/to/swift/bin/swift+0xe215f6)
14 0x0000000000c17215 swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) (/path/to/swift/bin/swift+0xc17215)
15 0x0000000000c4cec1 resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4cec1)
16 0x0000000000c4c861 swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4c861)
17 0x0000000000c4d9d7 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) (/path/to/swift/bin/swift+0xc4d9d7)
18 0x0000000000c4d8df swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4d8df)
19 0x0000000000c4bf87 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4bf87)
20 0x0000000000be0031 swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) (/path/to/swift/bin/swift+0xbe0031)
21 0x0000000000be922c (anonymous namespace)::DeclChecker::visitAssociatedTypeDecl(swift::AssociatedTypeDecl*) (/path/to/swift/bin/swift+0xbe922c)
22 0x0000000000be18de swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) (/path/to/swift/bin/swift+0xbe18de)
23 0x0000000000c16f6c swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) (/path/to/swift/bin/swift+0xc16f6c)
24 0x0000000000c4cec1 resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4cec1)
25 0x0000000000c4c861 swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4c861)
26 0x0000000000c4d9d7 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) (/path/to/swift/bin/swift+0xc4d9d7)
27 0x0000000000c4d8df swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4d8df)
28 0x0000000000c4bf87 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4bf87)
29 0x0000000000d32d5b swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) (/path/to/swift/bin/swift+0xd32d5b)
30 0x0000000000d09bc6 swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) (/path/to/swift/bin/swift+0xd09bc6)
31 0x0000000000bdedc9 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) (/path/to/swift/bin/swift+0xbdedc9)
32 0x0000000000be1a72 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) (/path/to/swift/bin/swift+0xbe1a72)
33 0x0000000000c523ed resolveTypeDecl(swift::TypeChecker&, swift::TypeDecl*, swift::SourceLoc, swift::DeclContext*, swift::GenericIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc523ed)
34 0x0000000000c52070 resolveTopLevelIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, swift::ComponentIdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc52070)
35 0x0000000000c4cc3d resolveIdentTypeComponent(swift::TypeChecker&, swift::DeclContext*, llvm::ArrayRef<swift::ComponentIdentTypeRepr*>, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4cc3d)
36 0x0000000000c4c861 swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4c861)
37 0x0000000000c4d9d7 (anonymous namespace)::TypeResolver::resolveType(swift::TypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>) (/path/to/swift/bin/swift+0xc4d9d7)
38 0x0000000000c4d8df swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4d8df)
39 0x0000000000c4bf87 swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) (/path/to/swift/bin/swift+0xc4bf87)
40 0x0000000000be0031 swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) (/path/to/swift/bin/swift+0xbe0031)
41 0x0000000000be179a swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) (/path/to/swift/bin/swift+0xbe179a)
42 0x0000000000bf5e4e (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) (/path/to/swift/bin/swift+0xbf5e4e)
43 0x0000000000be7ecc (anonymous namespace)::DeclChecker::visit(swift::Decl*) (/path/to/swift/bin/swift+0xbe7ecc)
44 0x0000000000be7dfd swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) (/path/to/swift/bin/swift+0xbe7dfd)
45 0x0000000000c59b92 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) (/path/to/swift/bin/swift+0xc59b92)
46 0x00000000009782d6 swift::CompilerInstance::performSema() (/path/to/swift/bin/swift+0x9782d6)
47 0x000000000047b02c performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x47b02c)
48 0x0000000000479f1e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/path/to/swift/bin/swift+0x479f1e)
49 0x0000000000439a17 main (/path/to/swift/bin/swift+0x439a17)
50 0x00007f0c5eca1830 __libc_start_main /build/glibc-Qz8a69/glibc-2.23/csu/../csu/libc-start.c:325:0
51 0x0000000000436e59 _start (/path/to/swift/bin/swift+0x436e59)
```
2016-11-30 19:05:58 +01:00