Commit Graph

434 Commits

Author SHA1 Message Date
Slava Pestov
e8abf54a9a Sema: Fixes for protocol typealiases
This is a big refactoring of resolveTypeInContext() which makes
the function clearer to understand by merging various special
cases and generalizing the logic for walking parent and superclass
contexts to cover more cases.

This improves typealiases in protocols a bit:

1) Previously a typealias in a protocol either had to be concrete,
   or consist of a single path of member types from Self, eg
   Self.A.B. Lift this restriction, so we can now write things like

protocol Fireworks {
  associatedtype Exploding
  typealias Exploder = Exploding -> [Exploding]
}

2) Protocol typealiases can now be accessed via qualified lookup
   on concrete types. Getting this working for unqualified lookup
   requires further refactorings which will be in a subsequent
   patch.
2016-06-11 16:24:14 -07:00
Dmitri Gribenko
14d0be2099 Revert "Sema: Clean up resolveTypeInContext() and generalize typealiases in protocols"
This reverts commit 586288312c.  It broke
tests:

    Swift :: IDE/complete_override_access_control.swift
    Swift :: IDE/complete_value_expr.swift
    Swift :: SourceKit/DocSupport/doc_swift_module.swift
    Swift :: decl/typealias/associated_types.swift
    Swift :: decl/typealias/typealias.swift
2016-06-09 00:06:06 -07:00
Slava Pestov
586288312c Sema: Clean up resolveTypeInContext() and generalize typealiases in protocols
Previously a typealias in a protocol either had to be concrete,
or consist of a single path of member types from Self, eg
Self.A.B. Lift this restriction.

Fix a few other corner cases that came up in the validation
suite, and clean up the function in general.
2016-06-08 20:17:59 -07:00
Slava Pestov
2c21b81910 AST: Clean up archetype mangling
Now that we have ArchetypeBuilder::mapTypeOutOfContext(), we can
delete some tricky hand-crafted logic for getting the depth and
index of archetypes.

Notice that the depth of an archetype is now the same as generic
parameters, where depth 0 is the outermost generic context.
Previously it was backwards.

Mostly NFC, except that a few IDE crashers are now fixed because
of asserts firing in removed code, and also the change to depth
mangling (which I think makes sense, and it matches what's written
in docs/ABI.rst).
2016-06-01 12:54:43 -07:00
John McCall
5c83792a8f Pad my commit count by carefully splitting the actual test change from
the commit that moved the test to the fixed directory.
2016-05-24 11:15:29 -07:00
John McCall
95c9d1fe7e "Fix" this crasher test by marking it resolved. 2016-05-24 11:09:55 -07:00
Slava Pestov
afd383f271 One more time -- utils/resolve_crashers.py doesn't do the right thing for IDE crashers 2016-05-21 14:42:40 -07:00
Slava Pestov
c69df44a83 Generic initializer inheritance changes fixed this IDE crasher that I forgot about 2016-05-21 13:52:45 -07:00
Ted Kremenek
82c0a779e7 XFAIL validation-test/IDE/crashers/011-swift-lookupvisibledecls.swift (SR-1583) 2016-05-21 11:31:47 -07:00
Mark Lacey
eb1c4dc240 Fix two validation tests that require asserts. 2016-04-16 16:10:51 -07:00
Jordan Rose
bc83940301 Make pointer nullability explicit using Optional.
Implements SE-0055: https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md

- Add NULL as an extra inhabitant of Builtin.RawPointer (currently
  hardcoded to 0 rather than being target-dependent).
- Import non-object pointers as Optional/IUO when nullable/null_unspecified
  (like everything else).
- Change the type checker's *-to-pointer conversions to handle a layer of
  optional.
- Use 'AutoreleasingUnsafeMutablePointer<NSError?>?' as the type of error
  parameters exported to Objective-C.
- Drop NilLiteralConvertible conformance for all pointer types.
- Update the standard library and then all the tests.

I've decided to leave this commit only updating existing tests; any new
tests will come in the following commits. (That may mean some additional
implementation work to follow.)

The other major piece that's missing here is migration. I'm hoping we get
a lot of that with Swift 1.1's work for optional object references, but
I still need to investigate.
2016-04-11 20:06:38 -07:00
Joe Groff
37dce05803 This validation-test no longer crashes. 2016-03-28 09:50:30 -07:00
Ben Langmuir
78e2e59351 [IDE] Fix crasher 063-swift-generictypeparamtype-get.swift
This test was crashing (except under asan) because we were using dead
pointers to stack memory where a TypeChecker used to live.
2016-03-21 11:39:43 -07:00
Michael Ilseman
8cb669dd56 Disable crasher test that ASAN somehow fixes.
The disabled crasher test does not crash with ASAN enabled, which is
particularly odd. Disable the test to unblock builders and testers
while diagnosing.
2016-03-18 16:54:00 -07:00
Ben Langmuir
812d1566a7 [CodeCompletion] Don't look through non-type contexts in override
We don't actually want to skip non-type contexts here, since we should
only be showing override completions in the type context itself. This
was pretty obscure to hit in practice, but I noticed it while fixing the
crasher.
2016-03-12 08:39:11 -08:00
Ben Langmuir
5bbc06b35c [CodeCompletion] Fix override completion parser lookback issues
This allows us to get override completions correct when
* There are multiple decls on one line
* The preceding attributes/keywords span multiple lines

Resolving a longstanding FIXME.
2016-03-11 23:00:11 -08:00
Ben Langmuir
47723848bd [CodeCompletion] Fix crash in override completion in a bogus context
Use the right context for getting the formal access. To get the
completions right, we should fix the FIXME about not backtracking the
parser so far.
2016-03-11 17:15:19 -08:00
gregomni
78216b2990 Change all remaining tests that use typealias in a protocol to use associatedtype. 2016-03-09 18:08:52 -08:00
Xi Ge
615d4cb756 [test] Remove 'not' because code completion prints result. 2016-02-27 22:52:31 -08:00
Xi Ge
380bc11c0e [test] Mark an IDE crash as fixed. 2016-02-27 22:01:20 -08:00
Dmitri Gribenko
a257715fcc Revert "[stdlib] [SE-0031] update stdlib for SE-0031 (inout adjustment)" 2016-02-26 11:17:10 -08:00
Daniel Duan
13b5c8f3bc [SE-0031] update code base for SE-0031 (inout adjustment) 2016-02-26 10:52:10 -08:00
Michael Gottesman
4691d741a3 Disable some SourceKit/IDE tests that fail with ASAN until after the stable merge. rdar://24540771. 2016-02-06 18:24:51 -08:00
Dmitri Gribenko
084e284c3f Mark a crash test as fixed 2016-02-02 17:03:54 -08:00
Chris Lattner
7c97117d77 Fix IDE crashers 027, 066, and 068.
Expand the "skip" functions in the parser to be more careful about
not skipping passed a #endif or a code completion token, since they
are synchronization points for the parser.

The fix was to change Parser::delayParseFromBeginningToHere to use
a manual loop instead of skipUntil (which can stop early for non-EOF
tokens).
2016-02-01 16:36:28 -08:00
Chris Lattner
ff34db7950 fix a few compiler crashers
These were due to CSDiags not reverting the semantic expr embedded in CollectionExprs
when retypechecking them.
2016-01-29 21:13:57 -08:00
Dmitri Gribenko
d7b05d647b Really mark the crash test as fixed 2016-01-29 19:38:36 -07:00
Chris Lattner
2715a9e46e Another testcase fixed by recent patches. 2016-01-29 17:04:26 -08:00
Slava Pestov
3550897090 The previous patch accidentally fixed some compiler_crashers 2016-01-27 23:51:20 -08:00
Dmitri Gribenko
220bac09a7 Remove 'asserts' requirements from fixed compiler crash tests 2016-01-20 14:40:36 -08:00
Chris Lattner
a2ea7b1335 Recent fixes fixed this testcase as well. 2016-01-17 13:11:38 -08:00
Chris Lattner
8bac0868c3 My changes fixed this test, and swift-ide-test is returning a successful exit code,
I should have removed the "not" as well as the --crash.
2016-01-12 16:04:40 -08:00
Ben Langmuir
93e3c72883 [swift-ide-test] Don't go past the end of input in removeCodeCompletionTokens
When matching an incomplete code-completion token #^...
2016-01-12 11:28:11 -08:00
Erik Eckstein
206d410cdc disable an IDE test to unblock the bots 2016-01-12 08:13:46 -08:00
Chris Lattner
2f78b70857 recent diagnostics changes fixed 5 crashers and broke 1. 2016-01-11 22:43:27 -08:00
Slava Pestov
cbb95a2910 Merge pull request #926 from jtbandes/innermost-params
[AST] Fix inconsistent handling of generic args & params during BoundGenericType::getSubstitutions
2016-01-09 23:30:06 -08:00
Jacob Bandes-Storch
b97cb48c2b [AST] Fix inconsistent handling of generic args & params during BoundGenericType::getSubstitutions
A decl’s full GenericSignature is set during validateGenericTypeSignature().

Then during ConstraintSystem::openTypes(), in ReplaceDependentTypes, the GenericArgs list is built from the generic signature (via getGenericParamTypes()) and passed into a new BoundGenericType.

In BoundGenericType::getSubstitutions(), the GenericArgs are assumed to match getGenericParamsOfContext()->getParams().

However, in reality, the GenericArgs include all levels of generic args, whereas getGenericParamsOfContext() are the params of the innermost context only, so the params array is accessed past its end.

This commit changes NominalTypeDecl::getGenericParamTypes() to return the innermost params, in order to match the output of BoundGenericType::getGenericArgs(). For clarity and to hopefully prevent future confusion, we also rename getGenericParamTypes() to getInnermostGenericParamTypes().
2016-01-09 02:19:28 -08:00
John McCall
e21b71a4e7 This test has been fixed. 2016-01-08 22:49:03 -08:00
practicalswift
0f256b7fe8 Fix IDE test suite: Update with expected exit code (0). 2016-01-08 22:44:10 +01:00
practicalswift
db9fa33be6 Move to IDE/crashers_fixed/
Fixed thanks to @nkcsgexi:s commit f5f796b648 :-)
2016-01-08 22:30:26 +01:00
practicalswift
7382b469b5 Update RUN line to reflect current non-crash status. 2016-01-08 22:28:29 +01:00
practicalswift
4ea2138292 Add AddressSanitizer (ASan) output to crash cases. 2016-01-08 20:04:15 +01:00
Dmitri Gribenko
53128deaa3 Merge pull request #874 from practicalswift/sourcekit-067-swift-constraints-constraintsystem-resolveoverload
[SourceKit] Add test case for crash triggered in swift::constraints::ConstraintSystem::resolveOverload(…)
2016-01-06 12:00:09 +02:00
Dmitri Gribenko
e9c5a60aa2 Merge pull request #880 from practicalswift/sourcekit-068-swift-typechecker-resolvetypewitness
[SourceKit] Add test case for crash triggered in swift::TypeChecker::resolveTypeWitness(…)
2016-01-06 11:59:46 +02:00
Xi Ge
40c1622a6d [test] Update test after fixing a crash. 2016-01-05 21:05:08 -08:00
practicalswift
c60387d426 [SourceKit] Add test case for crash triggered in swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*)
Stack trace:

```
found code completion token A at offset 127
6  swift-ide-test  0x000000000095ab41 swift::TypeChecker::resolveTypeWitness(swift::NormalProtocolConformance const*, swift::AssociatedTypeDecl*) + 193
7  swift-ide-test  0x0000000000b7a906 swift::NormalProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 150
8  swift-ide-test  0x0000000000b7a848 swift::ProtocolConformance::getTypeWitnessSubstAndDecl(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 40
9  swift-ide-test  0x0000000000b7afe6 swift::ProtocolConformance::getTypeWitness(swift::AssociatedTypeDecl*, swift::LazyResolver*) const + 6
10 swift-ide-test  0x0000000000952c4e swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 1070
12 swift-ide-test  0x000000000097ba3e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
14 swift-ide-test  0x000000000097c944 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
15 swift-ide-test  0x000000000097b94a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
16 swift-ide-test  0x0000000000928a6a swift::TypeChecker::checkInheritanceClause(swift::Decl*, swift::GenericTypeResolver*) + 4890
21 swift-ide-test  0x000000000092c021 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 5969
22 swift-ide-test  0x0000000000b71fcc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
23 swift-ide-test  0x000000000095293a swift::TypeChecker::lookupMemberType(swift::DeclContext*, swift::Type, swift::Identifier, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 282
25 swift-ide-test  0x000000000097ba3e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
27 swift-ide-test  0x000000000097c944 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
28 swift-ide-test  0x000000000097b94a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
29 swift-ide-test  0x00000000009eb7e2 swift::IterativeTypeChecker::processResolveInheritedClauseEntry(std::pair<llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>, unsigned int>, llvm::function_ref<bool (swift::TypeCheckRequest)>) + 146
30 swift-ide-test  0x00000000009eaa6d swift::IterativeTypeChecker::satisfy(swift::TypeCheckRequest) + 493
31 swift-ide-test  0x0000000000927709 swift::TypeChecker::resolveInheritanceClause(llvm::PointerUnion<swift::TypeDecl*, swift::ExtensionDecl*>) + 137
32 swift-ide-test  0x000000000092ace1 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 1041
34 swift-ide-test  0x0000000000930296 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
35 swift-ide-test  0x00000000008fca42 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
36 swift-ide-test  0x000000000076b4f2 swift::CompilerInstance::performSema() + 2946
37 swift-ide-test  0x0000000000714d83 main + 33379
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'a' at <INPUT-FILE>:3:3
2.	While resolving type A.e at [<INPUT-FILE>:5:13 - line:5:15] RangeText="A.e"
3.	While type-checking 'a' at <INPUT-FILE>:4:1
4.	While resolving type A.e at [<INPUT-FILE>:5:13 - line:5:15] RangeText="A.e"
```
2016-01-05 14:58:19 +01:00
practicalswift
ef798c7a2f [SourceKit] Add test case for crash triggered in swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice)
Stack trace:

```
found code completion token A at offset 177
swift-ide-test: /path/to/swift/lib/Sema/ConstraintSystem.cpp:1466: void swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator *, swift::Type, swift::constraints::OverloadChoice): Assertion `!refType->hasTypeParameter() && "Cannot have a dependent type here"' failed.
8  swift-ide-test  0x00000000009a656a swift::constraints::ConstraintSystem::resolveOverload(swift::constraints::ConstraintLocator*, swift::Type, swift::constraints::OverloadChoice) + 4074
9  swift-ide-test  0x00000000008e0681 swift::constraints::ConstraintSystem::simplifyConstraint(swift::constraints::Constraint const&) + 897
10 swift-ide-test  0x00000000008eae36 swift::constraints::ConstraintSystem::solveSimplified(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 3142
11 swift-ide-test  0x00000000008e8479 swift::constraints::ConstraintSystem::solveRec(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 313
12 swift-ide-test  0x00000000008e8239 swift::constraints::ConstraintSystem::solve(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 73
13 swift-ide-test  0x000000000090f9f6 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 614
14 swift-ide-test  0x0000000000915db9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
19 swift-ide-test  0x00000000009c7dd8 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 104
20 swift-ide-test  0x00000000009cc68e swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4046
21 swift-ide-test  0x000000000090fa25 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 661
22 swift-ide-test  0x0000000000915db9 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 569
23 swift-ide-test  0x0000000000916ed0 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 112
24 swift-ide-test  0x0000000000917079 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 265
26 swift-ide-test  0x000000000092b7f4 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 3876
27 swift-ide-test  0x0000000000b71fcc swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, unsigned int, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 2908
28 swift-ide-test  0x0000000000b709dd swift::UnqualifiedLookup::UnqualifiedLookup(swift::DeclName, swift::DeclContext*, swift::LazyResolver*, bool, swift::SourceLoc, bool, bool) + 2269
29 swift-ide-test  0x0000000000951c8b swift::TypeChecker::lookupUnqualified(swift::DeclContext*, swift::DeclName, swift::SourceLoc, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 187
32 swift-ide-test  0x000000000097ba3e swift::TypeChecker::resolveIdentifierType(swift::DeclContext*, swift::IdentTypeRepr*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, bool, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 158
34 swift-ide-test  0x000000000097c944 swift::TypeChecker::resolveType(swift::TypeRepr*, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 164
35 swift-ide-test  0x000000000097b94a swift::TypeChecker::validateType(swift::TypeLoc&, swift::DeclContext*, swift::OptionSet<swift::TypeResolutionFlags, unsigned int>, swift::GenericTypeResolver*, llvm::function_ref<bool (swift::TypeCheckRequest)>*) + 42
36 swift-ide-test  0x000000000094e08b swift::TypeChecker::checkGenericParamList(swift::ArchetypeBuilder*, swift::GenericParamList*, swift::DeclContext*, bool, swift::GenericTypeResolver*) + 715
37 swift-ide-test  0x000000000094f79f swift::TypeChecker::validateGenericSignature(swift::GenericParamList*, swift::DeclContext*, swift::GenericSignature*, std::function<bool (swift::ArchetypeBuilder&)>, bool&) + 143
38 swift-ide-test  0x000000000094fb54 swift::TypeChecker::validateGenericTypeSignature(swift::NominalTypeDecl*) + 116
39 swift-ide-test  0x000000000092aa32 swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 354
43 swift-ide-test  0x0000000000930296 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
44 swift-ide-test  0x00000000008fca42 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1474
45 swift-ide-test  0x000000000076b4f2 swift::CompilerInstance::performSema() + 2946
46 swift-ide-test  0x0000000000714d83 main + 33379
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking 'd' at <INPUT-FILE>:3:1
2.	While resolving type g at [<INPUT-FILE>:4:32 - line:4:32] RangeText="g"
3.	While type-checking expression at [<INPUT-FILE>:4:7 - line:4:9] RangeText="b<a"
4.	While type-checking expression at [<INPUT-FILE>:4:7 - line:4:7] RangeText="b"
```
2016-01-04 21:29:52 +01:00
Chris Lattner
c2f5ffa0ce Merge pull request #848 from practicalswift/sourcekit-064-swift-genericfunctiontype-get
[SourceKit] Add test case for crash triggered in swift::GenericFunctionType::get(…)
2016-01-01 13:26:01 -08:00
practicalswift
e55574aca4 [SourceKit] Add test case for crash triggered in swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&)
Stack trace:

```
found code completion token A at offset 144
swift-ide-test: /path/to/swift/lib/AST/ASTContext.cpp:2868: static swift::GenericFunctionType *swift::GenericFunctionType::get(swift::GenericSignature *, swift::Type, swift::Type, const swift::AnyFunctionType::ExtInfo &): Assertion `sig && "no generic signature for generic function type?!"' failed.
8  swift-ide-test  0x0000000000aa633e swift::GenericFunctionType::get(swift::GenericSignature*, swift::Type, swift::Type, swift::AnyFunctionType::ExtInfo const&) + 574
10 swift-ide-test  0x000000000092addc swift::TypeChecker::validateDecl(swift::ValueDecl*, bool) + 780
15 swift-ide-test  0x0000000000b51f70 swift::lookupVisibleDecls(swift::VisibleDeclConsumer&, swift::DeclContext const*, swift::LazyResolver*, bool, swift::SourceLoc) + 1168
18 swift-ide-test  0x000000000085c193 swift::performDelayedParsing(swift::DeclContext*, swift::PersistentParserState&, swift::CodeCompletionCallbacksFactory*) + 307
19 swift-ide-test  0x000000000076b5a4 swift::CompilerInstance::performSema() + 3316
20 swift-ide-test  0x0000000000714cc3 main + 33379
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking declaration 0x4dd8ad0 at <INPUT-FILE>:2:27
```
2016-01-01 21:31:41 +01:00
practicalswift
3c1c6c8ec0 [SourceKit] Add test case for crash triggered in swift::ConformanceLookupTable::expandImpliedConformances(swift::NominalTypeDecl*, swift::DeclContext*, swift::LazyResolver*)
Stack trace:

```
found code completion token A at offset 131
swift-ide-test: /path/to/swift/lib/AST/ConformanceLookupTable.cpp:497: void swift::ConformanceLookupTable::expandImpliedConformances(swift::NominalTypeDecl *, swift::DeclContext *, swift::LazyResolver *): Assertion `i <= 16384 && "Infinite loop due to circular protocol inheritance?"' failed.
8  swift-ide-test  0x0000000000bb3385 swift::ConformanceLookupTable::expandImpliedConformances(swift::NominalTypeDecl*, swift::DeclContext*, swift::LazyResolver*) + 821
9  swift-ide-test  0x0000000000bb1585 swift::ConformanceLookupTable::updateLookupTable(swift::NominalTypeDecl*, swift::ConformanceLookupTable::ConformanceStage, swift::LazyResolver*) + 1109
10 swift-ide-test  0x0000000000bb4504 swift::ConformanceLookupTable::lookupConformances(swift::NominalTypeDecl*, swift::DeclContext*, swift::LazyResolver*, swift::ConformanceLookupKind, llvm::SmallVectorImpl<swift::ProtocolDecl*>*, llvm::SmallVectorImpl<swift::ProtocolConformance*>*, llvm::SmallVectorImpl<swift::ConformanceDiagnostic>*) + 68
11 swift-ide-test  0x0000000000b7dfc8 swift::DeclContext::getLocalProtocols(swift::ConformanceLookupKind, llvm::SmallVectorImpl<swift::ConformanceDiagnostic>*, bool) const + 136
14 swift-ide-test  0x0000000000930426 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150
17 swift-ide-test  0x000000000097743a swift::TypeChecker::typeCheckClosureBody(swift::ClosureExpr*) + 218
18 swift-ide-test  0x00000000009adebc swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 812
19 swift-ide-test  0x000000000091603b swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 683
21 swift-ide-test  0x0000000000977586 swift::TypeChecker::typeCheckTopLevelCodeDecl(swift::TopLevelCodeDecl*) + 134
22 swift-ide-test  0x00000000008fccbd swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1581
23 swift-ide-test  0x000000000076b432 swift::CompilerInstance::performSema() + 2946
24 swift-ide-test  0x0000000000714cc3 main + 33379
Stack dump:
0.	Program arguments: swift-ide-test -code-completion -code-completion-token=A -source-filename=<INPUT-FILE>
1.	While type-checking expression at [<INPUT-FILE>:3:7 - line:6:12] RangeText="{
protocol e:A
protocol A:A
protocol c:e"
2.	While type-checking 'c' at <INPUT-FILE>:6:1
```
2016-01-01 21:24:58 +01:00