Commit Graph

12 Commits

Author SHA1 Message Date
Doug Gregor
38c1de69e4 Reinstate "[SR-511][Parse] Add 'associatedtype' keyword and fixit"
This reverts commit ce7b2bcf09, tweaking
a few validation tests appropriately (1 crasher fixed, two -verify
tests that needed updating).
2016-01-14 00:21:48 -08:00
Erik Eckstein
ce7b2bcf09 Revert "[SR-511][Parse] Add 'associatedtype' keyword and fixit"
This reverts commit 2b2e9dc80e.

It broke some compiler crasher tests
2016-01-13 20:42:58 -08:00
gregomni
2b2e9dc80e [SR-511][Parse] Add 'associatedtype' keyword and fixit
Adds an associatedtype keyword to the parser tokens, and accepts either
typealias or associatedtype to create an AssociatedTypeDecl, warning
that the former is deprecated. The ASTPrinter now emits associatedtype
for AssociatedTypeDecls.

Separated AssociatedType from TypeAlias as two different kinds of
CodeCompletionDeclKinds. This part probably doesn’t turn out to be
absolutely necessary currently, but it is nice cleanup from formerly
specifically glomming the two together.

And then many, many changes to tests. The actual new tests for the fixits
is at the end of Generics/associated_types.swift.
2016-01-13 17:54:31 -08:00
Doug Gregor
6af6048c0c AST printing: take more care to only escape 'Self' when needed.
Cleans up AST printing somewhat as well as providing slightly better
type-to-declaration mappings for annotated AST printing and indexing.

Swift SVN r32420
2015-10-03 05:13:52 +00:00
Jordan Rose
a2ec27777e Don't crash when a property and a member type have the same name.
The exact message is mostly immaterial at this point, but without the
change we end up recursively validating the property, marking it invalid,
and then never actually emitting a diagnostic, leaving SILGen and
Serialization to go ahead and fail.

rdar://problem/20913392

Swift SVN r30830
2015-07-31 00:49:41 +00:00
Slava Pestov
ccf21ff90a Revert "Sema: Fix infinite recursion when associated type default references itself"
This reverts revision r30688. The patch needs more work, because it flags a
valid case as circular, see r15054, "Relax restriction on indirectly-self-
recursive protocol conformances.  (rdar://problem/16306715)".

Swift SVN r30690
2015-07-27 06:41:10 +00:00
Slava Pestov
29d3f8f400 Sema: Fix infinite recursion when associated type default references itself
Fixes <rdar://problem/20985232>.

Swift SVN r30688
2015-07-27 05:05:05 +00:00
Chris Lattner
884de4b74c testcases fixed by r29538
Swift SVN r29539
2015-06-20 23:59:48 +00:00
Chris Lattner
9a65afff8d Two changes:
- In name lookup, if we find a decl that is already being type checked 
   (which only occurs on illegal code) just assume it is acceptable instead
   of blowing up with an assertion checking access control that hasn't been
   evaluated yet.
 - In checkInheritanceClause, make sure that the we mark the decl being
   resolved as being type checked when resolving the types involved.  That way,
   cyclic references are detected as invalid, instead of causing assertions and
   other explosions.

This fixes some compiler crashers.



Swift SVN r29538
2015-06-20 23:50:31 +00:00
Doug Gregor
f8bf365289 Rebrand TR_NominalInheritanceClause as TR_GenericSignature, and support functions.
It’s real intent is to check only the generic signature of the DeclContext provided to name lookup, then enclosing contexts. Use it for functions and initializers as well, so we have uniform lookup behavior for entities that can have generic parameters.

A follow-up commit contains some minor, semi-related tweaks along with a pile of updates to the compiler crash testsuite.

Swift SVN r26654
2015-03-27 23:57:39 +00:00
Jordan Rose
e635d6a993 In the spirit of r25276, break circularity with generic functions, too.
Also beef up the main test case a little.

I don't have a Radar, but this fixes 177 compiler_crashers!

Swift SVN r25281
2015-02-13 19:59:48 +00:00
Jordan Rose
f879f470bd Fix circularity issue checking the signature of a function.
This seems to already be working for variables in trunk, so it's just
functions that need the fix. (I'm not sure why the variables are emitting
the error twice, but I'm not going to spend time on that right now.)

rdar://problem/19715729

Swift SVN r25276
2015-02-13 18:50:08 +00:00