Commit Graph

66 Commits

Author SHA1 Message Date
Doug Gregor
b660580f35 Don't permit calling static methods on an instance <rdar://problem/13206762>.
Swift SVN r4033
2013-02-13 19:27:39 +00:00
Doug Gregor
75c8591487 When lookup finds a generic parameter, treat it like a local declaration, not a member declaration.
Swift SVN r3534
2012-12-18 22:50:49 +00:00
Doug Gregor
71a7408d13 Teach name lookup to remove overridden methods in extensions from its results.
While we haven't worked out the details of whether methods in
extensions can be overridden in Swift, it's something that does happen
in Objective-C, so we need to deal with it.

With this change, note that our demo application can both allocate
Objective-C objects with "new" (which John recently fixed) and also
subscript mutable arrays to both read and write.


Swift SVN r3485
2012-12-13 23:19:37 +00:00
Eli Friedman
bef302d2ee Initial attempt at implementing semantic analysis of overriding for classes.
Still a lot of missing pieces, but it mostly works.



Swift SVN r2633
2012-08-15 01:21:35 +00:00
Eli Friedman
6258942b30 Explicitly specify whether we're performing type lookup to the name lookup code, rather than deducing it from the translation phase.
Swift SVN r2312
2012-07-06 01:06:46 +00:00
Eli Friedman
ab2998431c Simplify our handling of tuple elements in the AST and Sema.
Swift SVN r2224
2012-06-21 21:30:57 +00:00
Doug Gregor
efd92be870 Introduce a form of TypeChecker::buildMemberRefExpr() that accepts the
results of member lookup, and eliminate all uses of
MemberLookup::createResultAST(). The AST library should not be
performing this semantic analysis.


Swift SVN r2221
2012-06-21 17:18:47 +00:00
Doug Gregor
f4bdd9ddf3 Introduce support for using static protocol functions within generics.
Swift SVN r2216
2012-06-20 17:59:03 +00:00
Doug Gregor
f847fe4a22 Introduce basic support for type-checking the definitions of generic
functions. This involves a few steps:

  - When assigning archetypes to type parameters, also walk all of the
  protocols to which the type parameter conforms and assign archetypes
  to each of the associated types.
  - When performing name lookup into an archetype, look into all of
  the protocols to which it conforms. If we find something, it can be
  referenced via the new ArchetypeMemberRefExpr.
  - When type-checking ArchetypeMemberRefExpr, substitute the values
  of the various associated types into the type of the member, so the
  resulting expression involves the archetypes for the enclosing
  generic method.

The rest of the type checking essentially follows from the fact that
archetypes are unique types which (therefore) have no behavior beyond
what is provided via the protocols they conform to. However, there is
still much work to do to ensure that we get the archetypes set up
correctly.



Swift SVN r2201
2012-06-19 21:16:14 +00:00
Eli Friedman
18dfa5cf7d More refactoring; allow ConstructorLookup to find constructors in classes.
Swift SVN r2171
2012-06-07 23:57:18 +00:00
Eli Friedman
72e1bed79e Refactoring for constructor lookup.
Swift SVN r2170
2012-06-07 23:33:08 +00:00
Eli Friedman
89e8b73607 A couple minor tweaks to UnqualifiedLookup.
Swift SVN r2111
2012-06-02 00:54:07 +00:00
Eli Friedman
82755cb06c Add a few comments.
Swift SVN r2110
2012-06-01 23:38:09 +00:00
Eli Friedman
d829b3c775 Unify the complete unqualified lookup logic in the UnqualifiedLookup class.
Swift SVN r2109
2012-06-01 23:26:58 +00:00
Eli Friedman
0e7ef8cebb Start refactoring code towards a single complete implementation of unqualified lookup.
Swift SVN r2108
2012-06-01 01:37:44 +00:00
Eli Friedman
29a13e9ae0 Move the NameLookup class into the AST library.
Swift SVN r2101
2012-05-31 22:35:50 +00:00