Commit Graph

11 Commits

Author SHA1 Message Date
Tim Chevalier
f7641286b2 Allow classes to be cast to ifaces that are in the same crate
I had to xfail one existing test case (class-implements-int) because,
I think, of the same bug described in #2272.
2012-04-23 21:15:03 -07:00
Marijn Haverbeke
a872a99bfe Simplify representation of ast::path 2012-04-23 13:04:46 +02:00
Tim Chevalier
37b0549730 Add new syntax for patterns that match the head constructor only
Adds a new kind of pattern C(*) where C is a constructor that may
have any number of fields. This pattern matches any value
constructed with C, without binding names for any of the fields.

Closes #1701.
2012-04-20 00:56:46 -07:00
Niko Matsakis
3c995fb8f3 make nominal types optionally parameterized by a self region.
Issue #2201.
2012-04-19 21:01:11 -07:00
Tim Chevalier
1da18c70ac Clean up FIXMEs in syntax::fold
Eta-reduce a function, fold over ty constrs, and annotate a FIXME.
2012-04-19 15:30:58 -07:00
Tim Chevalier
5c12cd72f4 Allow classes to implement ifaces
Introduce syntax like:

iface animal { ... }
class cat implements animal { ... }

to allow classes to implement ifaces. Casting classes to ifaces
is *not* yet supported. ifaces that a class implements are not
yet included in metadata.

The syntax is subject to change, and may go away completely if we
decide to use duck typing to relate classes with ifaces (see
http://smallcultfollowing.com/babysteps/blog/2012/04/10/declared-vs-duckish-typing/ )
2012-04-11 16:20:01 -07:00
Graydon Hoare
7a3b290245 Add vstore/evec/estr to compiler. 2012-04-11 11:08:40 -07:00
Tim Chevalier
fd26743bed Generic classes and generic class methods work cross-crate
Classes can have ty params now. So can methods inside classes.
That was probably true before, but now it should still work if you
call methods in a class that's defined in a different crate. Yay!
2012-04-10 11:01:36 -07:00
Marijn Haverbeke
fc202ca034 Remove support for old-style for
Closes #1619
2012-04-06 20:38:23 +02:00
Marijn Haverbeke
c902eafa14 Convert old-style for loops to new-style
Most could use the each method, but because of the hack used to
disambiguate old- and new-style loops, some had to use vec::each.

(This hack will go away soon.)

Issue #1619
2012-04-06 20:38:23 +02:00
Brian Anderson
5c25e78b27 rustc: Move fold to rustsyntax 2012-03-29 14:42:30 -07:00