Commit Graph

3102 Commits

Author SHA1 Message Date
Asumu Takikawa
81a7b3b55e Use class instead of class: for typed classes
original commit: a6daafd70a58a988f3c7c6795eb56ce84d541882
2014-02-20 16:50:25 -05:00
Asumu Takikawa
4947ef6e53 Add support for basic polymorphic classes
original commit: 91729c060cd431cb3b438aa6f0d3572ed456ab22
2014-02-20 16:50:25 -05:00
Asumu Takikawa
f59585bb5a Improve handling of expected type
original commit: 71d590604f33ecf9e9f2fb31307b4b01f79fc048
2014-02-20 16:50:25 -05:00
Asumu Takikawa
6bd6b9e1e2 Add expected error messages to class tests
original commit: e3efb90a59e08f30636fce70ffaeae28c59dfd2c
2014-02-20 16:50:25 -05:00
Asumu Takikawa
fcc096d51d Fix contracts on TR functions
original commit: 86093f88beb97120f1fe41a38e8c4741ff1043bc
2014-02-20 16:50:25 -05:00
Asumu Takikawa
0dd6b87991 Improve several type error messages
In particular, improve the syntax reported when the
method arity is wrong.

original commit: 6cdc5fb720cb69a9c6c541632e0e97bd571f1b23
2014-02-20 16:50:25 -05:00
Asumu Takikawa
1722644560 Enforce method types as function types in parsing
original commit: 0d498e18e7c6284a87797e7491906523ca641fe1
2014-02-20 16:50:25 -05:00
Asumu Takikawa
707de1ef68 Add a unit test for ill-typed private methods
original commit: 7ba8dd57cbffe66bb76cab053fed6e80cc193693
2014-02-20 16:50:25 -05:00
Asumu Takikawa
fd9c06e10f Support pubment and augment methods
This required changes to the type and row
representation. I also got rid of the redundancy
between Row and Class types.

Some other bugs had to be quashed for these
changes, such as private methods not actually
being type-checked.

original commit: eb95264e3f3d04e0427f01f26e19447ad9fe4b12
2014-02-20 16:50:25 -05:00
Asumu Takikawa
e0da126e85 Make type parsing error more informative
original commit: 1dede055492351e2d1d96b95dd5267741d359a03
2014-02-20 16:50:24 -05:00
Asumu Takikawa
3d741fced7 Fix class type subtyping
Although classes have no non-trivial subtyping relationships,
the representation I chose ends up introducing cases where two
"equal" types are not represented in the same way. This
commit fixes that by checking only the relevant parts of the
representation.

original commit: 92e34ebab960496f7b2faf6502ca895b2d2e00ae
2014-02-20 16:50:24 -05:00
Asumu Takikawa
3ce105ffde Implement row polymorphism
- Refactor syntax classes and parsing for class types in
    order to accommodate constraints for row polymorphism
  - No contract generation, but other parts are implemented

original commit: 939c3bb4c8aeafe7673e70db9398414ab2e29260
2014-02-20 16:50:24 -05:00
Asumu Takikawa
3bd5ae4ac6 Change #:extends to #:implements
original commit: 884c898bfa04c2334317c5a4ee96e7354804865d
2014-02-20 16:50:24 -05:00
Asumu Takikawa
1be1fb5e18 Add parsing for (Object ...) types into Instances
original commit: c47531569a204c789d00c413abc70494738b137a
2014-02-20 16:50:24 -05:00
Asumu Takikawa
cd6f49d645 Improve object type printing
Use the `Object` constructor style instead of `Instance`
in cases where it makes sense.

original commit: 32f39ddff49c09db5533aab8baba1a202f2332f7
2014-02-20 16:50:24 -05:00
Asumu Takikawa
3b46f8aec3 Add syntactic sugar for recursive class types
original commit: 081cc4777ae59044af3631d5e58d56fec25bbda6
2014-02-20 16:50:24 -05:00
Asumu Takikawa
49eb5a40a0 Attempt to support recursive types in classes better
original commit: a1efc2c276e7a37d3ae9faff6414e5a54e9bdcbf
2014-02-20 16:50:24 -05:00
Asumu Takikawa
dbfba09d05 Remove debug displays
original commit: 16ca57500b3446866668fc80f7287f9cb4939f27
2014-02-20 16:50:24 -05:00
Asumu Takikawa
d78377c5af Attempt to allow recursive types in objects/classes
Contract generation is not implemented correctly yet
since the static contract portion needs adjustment.

original commit: 19b1ca17c63463a40542366e040cb981066228bf
2014-02-20 16:50:24 -05:00
Asumu Takikawa
00a4494ba7 Allow duplicate type names if they have the same type
original commit: cc61f0639ec433061d491ba7bf1023cccaf2020f
2014-02-20 16:50:24 -05:00
Asumu Takikawa
97cd75165d Add "multiple inheritance" for class types
original commit: f84cf996c36a78a43a13827411a7d498c6cabf05
2014-02-20 16:50:24 -05:00
Asumu Takikawa
9ca8361ced Don't add super-type inits into type with #:extends
original commit: 4543204e859cddfa6abacd52ff725ceb6dca6ee6
2014-02-20 16:50:24 -05:00
Asumu Takikawa
defa74d44a Support private fields
original commit: bbd5d97a230bf8bab1d4bf3e5d88a606b86e637e
2014-02-20 16:50:23 -05:00
Asumu Takikawa
a2250fad43 Add super calls
(also removed bogus super-new init test)

original commit: 45599812128b2d5b1f52db91b792ffeec5c8ad40
2014-02-20 16:50:23 -05:00
Asumu Takikawa
07206b7f17 Don't make mandatory super inits mandatory for super-new
original commit: ba70851ba0dd7f812dd5f10dee36b2008e74f103
2014-02-20 16:50:23 -05:00
Asumu Takikawa
d7f6d81607 Fix type-checking for fields with this
original commit: f82a49be7dbf6e0abb5598179e85a5a06cb0cf2b
2014-02-20 16:50:23 -05:00
Asumu Takikawa
5dd26e30dc Fix subtyping for fields
original commit: 6b5875a1f1c4250a996e461609682d22ba428194
2014-02-20 16:50:23 -05:00
Asumu Takikawa
9d5a2d5f36 Make keyword methods type-check
Note: send does not work with keyword methods yet

original commit: 5da60f70673cd997b746b2fc437f9f8a055216dd
2014-02-20 16:50:23 -05:00
Asumu Takikawa
88af42a16a Add support for inherited methods
original commit: 4e5d0846baec22d8b23bc34a86c61881d8b36ca0
2014-02-20 16:50:23 -05:00
Asumu Takikawa
d04f0b6727 Attempt better error message for bad method type case
original commit: 30e3c498867dcd6b188157321b4ae7c5491329f2
2014-02-20 16:50:23 -05:00
Asumu Takikawa
d113733ab8 Better support for class top-level behavior
original commit: 0d5a775a62eb6dae2dba92012f49f9467685a4b1
2014-02-20 16:50:23 -05:00
Asumu Takikawa
ddf31e527e Allow top-level expressions to refer to inits
original commit: b9a175eed277138f9f4216b2f4694a3e27b7d7bb
2014-02-20 16:50:23 -05:00
Asumu Takikawa
290abc0333 Cleanup FIXME comments
original commit: 384e1392bd985c7f376f54df9a24374a40532e35
2014-02-20 16:50:23 -05:00
Asumu Takikawa
9e17db7f38 Improve super-new handling.
Now `super-new` calls are type-checked with the right
context so that init arguments can be passed as arguments.

In addition, the `super-new` checking was factored out into
three functions.

original commit: 6f86c66199bde3989a0b603b7386baa58167247d
2014-02-20 16:50:23 -05:00
Asumu Takikawa
25b1b3f648 Fix optional argument check that was broken
original commit: 44f9b87f02480b3e805b9891f3e31d49c7a3f410
2014-02-20 16:50:23 -05:00
Asumu Takikawa
e8575dbe9a Make init defaults work correctly as well
original commit: 14eeab934c521c36c71ed4628d897a2a31f09c6e
2014-02-20 16:50:23 -05:00
Asumu Takikawa
daccd31c15 Get init-field working in most cases
original commit: aa830a346123fdc092a4bceddfaf0276ab6e096c
2014-02-20 16:50:23 -05:00
Asumu Takikawa
94535805cd Type-check field initialization
Also fixed local accessors when internal names are used that
are different from external names.

original commit: 267a37134ef164f7d8bd9e3ffe6006ab16cf4bf2
2014-02-20 16:50:23 -05:00
Asumu Takikawa
15e21bb39f Factor out class expansion parsing
This commit prepares the code for more interesting parsing
of the initializer body (for expansion-introduced top-level
expressions for example) and faster parsing of methods and
other things in a single pass.

original commit: 6ce16e15380197f4cee9f44ca7ad42a34acc2c81
2014-02-20 16:50:23 -05:00
Asumu Takikawa
3ad23f8986 Fix non-expected case with inits/fields missing annotations
Also fix bogus test cases and the bug that hid them

original commit: 599beeae522f63a2007b3f17346ea7d91feeeca3
2014-02-20 16:50:23 -05:00
Asumu Takikawa
e942e91fb5 Check more clause presence/absence appropriately
original commit: f188d7f1030d4d48abe3d5d6cc2759403808084d
2014-02-20 16:50:22 -05:00
Asumu Takikawa
7bf90d1894 Rule out multiple super-new
original commit: f010a9ce71384a8412988ce60ea266e5fd3e8fa2
2014-02-20 16:50:22 -05:00
Asumu Takikawa
87f9ad8c18 Add support for private methods
original commit: 0ef255916dbc5fb663ebd5cf975e46a45d027088
2014-02-20 16:50:22 -05:00
Asumu Takikawa
aaf40266d1 Fix bug that triggers due to missing super-new
original commit: ab8513f48d8ae490e0ed9bd4c1ea34240c4de74e
2014-02-20 16:50:22 -05:00
Asumu Takikawa
4aa3c2a639 Make sure super inits that are provided don't count
original commit: c009948627fea6555a91e37e5d76c8370d0df13f
2014-02-20 16:50:22 -05:00
Asumu Takikawa
6fd920cee9 Make sure superclass mandatory inits are provided
original commit: b1627984e258df8f23d1295ec554fe0d5b128ea5
2014-02-20 16:50:22 -05:00
Asumu Takikawa
a91d41a453 Fix inheritance without expected type
original commit: c16a3b2350530c1858dacb8d1b7ea70fc42f1081
2014-02-20 16:50:22 -05:00
Asumu Takikawa
e54413e95a Set init arguments as optional correctly
original commit: d8a303983024a416be66b69f060270d2b39d4bb5
2014-02-20 16:50:22 -05:00
Asumu Takikawa
f4c8fd57e0 Make internal/external names work
original commit: f895e3156f26d01a5c62c18d675514204440f9ff
2014-02-20 16:50:22 -05:00
Asumu Takikawa
21b9774043 Better class types when no expected type given
original commit: ae2866e8ca7eb1c7822bb71518bd5db9adc95dfa
2014-02-20 16:50:22 -05:00