Commit Graph

566 Commits

Author SHA1 Message Date
practicalswift
48c40de31e Sync with https://github.com/practicalswift/swift-compiler-crashes
Add 2 compiler crashes (+ 1 fixed crash).
2015-12-27 19:35:50 +01:00
Doug Gregor
cd1c106e35 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-18 15:45:48 -08:00
Doug Gregor
3ba3bd359b Merge pull request #620 from jtbandes/member-fix
More error checking for member type lookup
2015-12-18 10:49:06 -08:00
Doug Gregor
a97ab6dd14 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-18 10:15:47 -08:00
Chris Willmore
92d230993a Merge pull request #619 from jtbandes/subscript-fix
Propagate ErrorType when checking subscript decls
2015-12-17 17:25:22 -08:00
Doug Gregor
824088a07d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 15:50:24 -08:00
Dmitri Gribenko
e31aae83ae Remove 'REQUIRES: asserts' from fixed crash tests: they don't crash anymore in any configuration 2015-12-17 14:54:32 -07:00
Max Moiseev
3fe0c60d7f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-17 11:00:02 -08:00
Jacob Bandes-Storch
ac95c1318f More error checking for member type lookup 2015-12-17 01:50:53 -08:00
Jacob Bandes-Storch
37207165f0 More error checking for subscript decls 2015-12-17 00:40:01 -08:00
Slava Pestov
d6ea5d8717 Sema: Chain all generic parameter lists
Previously, methods on DeclContext for getting generic parameters
and signatures did not walk up from type contexts to function
contexts, or function contexts to function contexts.

Presumably this is because SIL doesn't completely support nested
generics yet, instead only handling these two special cases:

- non-generic local function inside generic function
- generic method inside generic type

For local functions nested inside generic functions, SIL expects
the closure to not have an interface type or generic signature,
even if the contextual type signature contains archetypes.
This should probably be revisited some day.

Recall that these cases are explicitly rejected by Sema diagnostics
because they lack SIL support:

- generic function inside generic function
- generic type inside generic function

After the previous patches in this series, it becomes possible to
construct types that are the same as before for the supported uses of
nested generics, while introducing a more self-consistent conceptual
model for the unsupported cases.

Some new tests show we generate diagnotics in various cases that
used to crash.

The conceptual model might still not be completely right, and of
course SIL, IRGen and runtime support is still missing.
2015-12-16 11:32:56 -08:00
Max Moiseev
2021dd5a4d Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2015-12-15 12:49:22 -08:00
Slava Pestov
57dfb45ba6 Sema: Add DeclContext::isGenericTypeContext()
Once nested generic parameter lists are properly chained, we need a
way of checking if we're inside a generic type context that's
distinct from just checking if we have a generic type signature
available.

This distinguishes between these two cases:

class A<T> {
  // generic signature
  func method() -> T { // <T> A<T> -> () -> T
  }
}

func f<T>() {
  class A {
    // no generic signature
    func method() -> T { // A -> () -> T
    }
  }
}
2015-12-14 13:46:45 -08:00
Slava Pestov
c258f991f6 Sema: Nuke NominalTypeDecl::markInvalidGenericSignature()
This would just set the NominalTypeDecl's declared type to
ErrorType, which caused problems elsewhere.

Instead, generalize the logic used for AbstractFunctionDecl.
This correctly wires up the GenericTypeParamDecl's archetypes even
if the signature didn't validate, fixing crashes if the generic
parameters of the type are referenced.
2015-12-14 13:29:55 -08:00
Slava Pestov
d56cbfaaf9 Sema: Check generic parameter inheritance clause after creating archetype
This fixes a crash with invalid code where the inheritance clause
refers back to itself, eg struct E<F : F.A> {}.
2015-12-14 13:29:52 -08:00
Max Moiseev
806be29941 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-14 12:05:35 -08:00
Jacob Bandes-Storch
1b142ed054 Add missing setIsParseError() during enum case parsing
An invalid `case` construct would incorrectly return a successful status, causing `parseDecl` to crash later when it assumed there were valid decls in the `Entries` vector.
2015-12-13 13:11:22 -08:00
Max Moiseev
786e1ea2b1 Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-11 15:19:02 -08:00
Dmitri Gribenko
06d6dab133 Merge pull request #438 from practicalswift/sync-with-swift-compiler-crashes-20151211
Sync with https://github.com/practicalswift/swift-compiler-crashes
2015-12-11 14:42:05 -08:00
Doug Gregor
851f2eaf60 Merge pull request #272 from jtbandes/fix3
[AST] Improve ErrorType handling in TypeBase::getMemberSubstitutions()
2015-12-11 13:55:59 -08:00
Doug Gregor
53b1503a78 Merge pull request #253 from jtbandes/master
Fix crash in `DependentGenericTypeResolver::resolveDependentMemberType`
2015-12-11 13:53:01 -08:00
practicalswift
fe2bc2421e Sync with https://github.com/practicalswift/swift-compiler-crashes
Add 5 compiler crashes (+ 1 fixed crash).
2015-12-11 21:35:06 +01:00
Slava Pestov
f6e4355b69 Sema: Fix monthly TypeNullifier bug
This time, the issue is that TypeNullifier skips bodies of
multi-statement closures. However, ExprRewriter will type
happily pass them on to typeCheckClosureBody(). This could
trigger assertions. Fix this by skipping type checking of
multi-statement closures when diagnosing.

There seems to be a minor QoI regression in some test cases
that already looked pretty dodgy and/or had FIXMEs. However
I think its worth fixing a crash.
2015-12-11 08:58:52 -08:00
Maxim Moiseev
2c95bb6d51 BooleanType => Boolean 2015-12-10 14:56:32 -08:00
Jacob Bandes-Storch
61dea21228 Fix crash in DependentGenericTypeResolver::resolveDependentMemberType
An erroneous `baseTy` would cause resolveArchetype to return nullptr, resulting in a null dereference.
2015-12-10 14:52:53 -08:00
Dmitri Gribenko
21f081fc1a Merge pull request #405 from practicalswift/normalize-run-directives
Compiler crashers: Normalize format of "RUN:" directives.
2015-12-10 14:36:19 -08:00
Dmitri Gribenko
5995ef2acd Mark one crasher test as fixed on OS X 2015-12-10 14:30:17 -08:00
practicalswift
eae3eea17f Compiler crashers: Normalize format of "RUN:" directives.
Will allow for easy parsing of common "RUN:" directives.
2015-12-10 22:58:00 +01:00
Jacob Bandes-Storch
71b15e9a06 [AST] Improve ErrorType handling in TypeBase::getMemberSubstitutions()
Historical note: a similar change was made in 0033bda.
2015-12-10 13:11:06 -08:00
Dmitri Gribenko
3e5ce67605 Merge pull request #398 from practicalswift/rename-to-match-naming-in-swift-compiler-crashes
Rename old crash cases to match the current naming scheme.
2015-12-10 13:02:21 -08:00
Max Moiseev
d610fa0d1c Merge remote-tracking branch 'origin' into swift-3-api-guidelines 2015-12-10 10:29:52 -08:00
practicalswift
6029492e9f Remove since identical with 01739-swift-constraints-constraintsystem-solvesimplified.swift. 2015-12-10 17:03:34 +01:00
practicalswift
d132d07b53 Remove since identical with 00924-swift-parser-consumetoken.swift. 2015-12-10 17:02:33 +01:00
practicalswift
dc5a6a740f Remove since identical with 00805-swift-constraints-constraintsystem-opengeneric.swift. 2015-12-10 17:01:30 +01:00
practicalswift
7efd093c6f Remove since identical with 0035-cerror.swift. 2015-12-10 17:00:04 +01:00
practicalswift
c4866885c8 Rename old crash cases to match the current naming scheme.
Will allow for easy import of crash cases from swift-compiler-crashes.
2015-12-10 16:50:15 +01:00
Maxim Moiseev
844b81c46b SequenceType => Sequence 2015-12-09 17:16:56 -08:00
Maxim Moiseev
09a6913622 RangeReplaceableCollectionType => RangeReplaceableCollection 2015-12-09 17:13:08 -08:00
Maxim Moiseev
7e2466c14e CollectionType => Collection 2015-12-09 17:12:48 -08:00
Max Moiseev
67f02296a4 Fixing validation tests
There is no longer a free `map` function so one of the crashers goes to
'fixed', and another one is changed to use `print` instead of a
`println`.
2015-12-09 17:11:54 -08:00
Dmitri Gribenko
2cf172160c Rename SequenceType.Generator associated type to SequenceType.Iterator 2015-12-09 17:11:05 -08:00
Chris Lattner
1a1ccd1975 My diagnostics changes from last night fixed these three crashers, move them and remove --crash. 2015-12-08 09:02:24 -08:00
Jacob Bandes-Storch
e437a0e14c Fix duplicate error and re-categorize test
This crashing test became non-crashing in #138. #138 also emitted multiple instances of the same diagnostic, which was causing -verify to fail on decl/protocol/req/recursion.swift.
2015-12-07 02:28:37 -08:00
Jacob Bandes-Storch
b8bfdbc72e Fix logic error in ArchetypeBuilder::mapTypeIntoContext 2015-12-06 14:33:06 -08:00
Dmitri Gribenko
a35567d5be Merge pull request #280 from practicalswift/sync-with-swift-compiler-crashes-20151206
Sync with https://github.com/practicalswift/swift-compiler-crashes
2015-12-06 14:00:01 -08:00
practicalswift
ebdf6805ba Remote "not" from RUN line of valid programs. 2015-12-06 22:30:18 +01:00
practicalswift
7907831a45 Mark as fixed (RUN). 2015-12-06 06:19:43 -05:00
practicalswift
aff2d73867 Mark as fixed. 2015-12-06 06:17:23 -05:00
David Farler
846a6dcf07 Revert "Fix test flags"
This reverts commit e0b4d55545.

Revert "Include crashing test case"

This reverts commit e5dd189aaf.

Revert "Compare rvalue types in assertion"

This reverts commit 1952739f9d.

This series of commits still was leading to a crash in IRGen.
There is an incorrect ref_to_unmanaged further up in the function
with the wrong input type, so something is weird with preparing
the AutoreleasingUnsafeMutablePointer.

https://bugs.swift.org/browse/SR-87
2015-12-06 02:15:21 -08:00
Robert Widmann
e0b4d55545 Fix test flags 2015-12-06 01:55:43 -05:00