Commit Graph

9 Commits

Author SHA1 Message Date
Chris Lattner
868a795566 Introduce a new class between TypeDecl and NominalTypeDecl named GenericTypeDecl.
This factors the DeclContext and generic signature behavior out of NTD, allowing
it to be reused in the future.  NFC.
2016-03-04 23:09:15 -08:00
Daniel Duan
efe230774b [AST] rename some isXXX methods to getAsXXX
There's a group of methods in `DeclContext` with names that start with *is*,
such as `isClassOrClassExtensionContext()`. These names suggests a boolean
return value, while the methods actually return a type declaration. This
patch replaces the *is* prefix with *getAs* to better reflect their interface.
2016-02-11 16:23:40 -08:00
practicalswift
c48a25647d Use correct formatting for separator line. 2016-01-05 09:49:00 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Chris Lattner
feace85d5a Enhance SubscriptDecl to be a DeclContext, so it can hold its indices.
This is necessary for some other work I'm doing, which really wants
paramdecls to have reasonable declcontexts.  It is also a small step
towards generic subscripts.
2015-12-31 12:38:28 -08:00
Doug Gregor
2d324cac45 Minor cleanups in the iterative type checker. NFC
Only use the existing type checker (via "TC") in the iterative type
checker when we're actually making use of its functionality. The
intent is to drive this usage down to zero as we port code over to the
iterative type checker, so unprincipled uses get in the way.

Swift SVN r32573
2015-10-09 17:18:50 +00:00
Doug Gregor
8c9be9be12 Iterative type checker: simple circular reference detection.
Put in some rudimentary logic for finding circular references within
the iterative type checker and diagnosing those cycles. The
"rudimentary" part is because we're performing linear searches within
a stack rather than keeping a proper dependency graph, which is
inefficient and could display longer cycles than are actually
present. Additionally, the diagnostic is not specialized to the actual
query, so we get a generic "circular reference" diagnostic. OTOH, we
show all of the declarations involved in the cycle, which at least
lets the user figure out where the cycle occurred.

Enable the iterative type checker for resolving the type of a global
typealiases.

Swift SVN r32572
2015-10-09 17:18:49 +00:00
Doug Gregor
bbf335e596 Iterative type checker: make request construction more convenient.
Add free functions request##Request(PayloadType), rather than having
to directly construct TypeCheckRequest objects.

Swift SVN r32568
2015-10-09 17:18:45 +00:00
Doug Gregor
bef46010b7 Iterative type checker: add requests for name lookup.
These requests are, thus far, unused.

Swift SVN r32566
2015-10-09 17:18:44 +00:00