Commit Graph

3217 Commits

Author SHA1 Message Date
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
Asumu Takikawa
06c9398293 Fix top-level use of classes
original commit: 2ae1f5a602f843f9c854de9809916a60ff767cc5
2014-02-20 16:50:22 -05:00
Asumu Takikawa
59a5c57f42 Type-check class top-level expressions
original commit: dc35a8cd4db8f2a0cf9424aac50aad7960eb1074
2014-02-20 16:50:22 -05:00
Asumu Takikawa
4356293a59 Support tc-expr and not just tc-expr/check
Note: the type is too conservative in some cases with
      tc-expr (if you leave : annotations out). This should
      be fixed in the future.

original commit: 6a43fac5c27d46f1bb456e861f55c4b2dddca455
2014-02-20 16:50:22 -05:00
Asumu Takikawa
2ee160cc8c Add infrastructure for private methods
They don't actually work yet, because I don't yet know
how to assign them types for when they're called locally.
Probably requires the two pass approach for locals.

original commit: 709f3c66960fc08b77a7978c7c64ddb3e27b4c45
2014-02-20 16:50:22 -05:00
Asumu Takikawa
d1ae0dc0e9 Add support for local field access
original commit: 6c0e82f15bc1dda5b984d4ddf21c41de9eb80315
2014-02-20 16:50:22 -05:00
Asumu Takikawa
28096a6385 Add support for override
original commit: 931556264e4fea7c1c3e5f289aade11e511c60d4
2014-02-20 16:50:22 -05:00
Asumu Takikawa
f028ab23b3 Check super-new calls
Still need to use this information to adjust the class
type init clauses

original commit: 060aaa8b26c05ca8800db0d3444b5f4c4a09bf4f
2014-02-20 16:50:21 -05:00
Asumu Takikawa
f058d684b6 Add unit tests for classes
original commit: 77847de94436dcaf8389236d14251110fa7c138a
2014-02-20 16:50:21 -05:00
Asumu Takikawa
bc07b8b140 Initial work on type-checking class expressions
Add a `class:` macro that adds instrumentation for
the type-checker. Also add type-checking for the
expansion of that macro.

original commit: 244135a96e8c6e98e6a77052813b53d4f284443f
2014-02-20 16:50:21 -05:00
Asumu Takikawa
744c8593d6 Clean up object init and add support for get-field
original commit: 684fabde1bdfa92279c413ab612f2771db2f2f9e
2014-02-20 16:50:21 -05:00
Asumu Takikawa
68518c74fc Add new Class type representation
This commit introduces a new Class type representation
and adds initial support for parsing the new types.

Existing uses of Class types are adjusted to compile.

original commit: 72c991c1de2ad964657883422d18cea3f6429eb2
2014-02-20 16:50:21 -05:00
Asumu Takikawa
ecc82246af Make TR's for/hash form more flexible
original commit: d35fb82f4a583a6b27164ecd92fd8d52c0dd72db
2014-02-20 14:13:41 -05:00
Asumu Takikawa
9a4ee81604 Add TR case-lambda with optional type annotations
original commit: 58a3d12f0c1e27b2ea45bcb1c8ee1243825d28b1
2014-02-20 13:54:32 -05:00
Asumu Takikawa
4216d01b2d TR: move helper syntax classes to helper file
original commit: ed98404aafea1f9d0142dabdba73dcf7f16dda73
2014-02-20 12:05:11 -05:00
Asumu Takikawa
f57a8f5e96 Add test for PR 13937
The actual bug was already fixed by enabling multi-valued
sequence syntax in TR `for` loop forms.

Closes PR 13937

original commit: 8d4b3ee396a645a828594b7b9afdcaf7e5676ccd
2014-02-20 00:06:45 -05:00
Asumu Takikawa
9ee89f821d Document legacy forms with a : suffix
Also don't export internal macros

original commit: a17e4578404b7eb243e1b7dbfb749b1df6e44215
2014-02-19 21:20:48 -05:00
Asumu Takikawa
43060c8d37 Revise TR Reference for new :-less forms
original commit: 768d04fa975097097af18d2fae1be108cbf3abbe
2014-02-19 16:40:40 -05:00
Asumu Takikawa
4f2bd7180f Provide :-less versions of all for forms.
Modify the forms as needed to accept non-annotated
bindings to match the untyped versions. Also fixes
bugs in syntax classes found along the way.

original commit: 37b09521ac3493ed45963aedacf7a263194aec1a
2014-02-19 16:40:40 -05:00
Asumu Takikawa
28cba9af4a Accept polydots rest in TR lambda and define
Also accept type variables before formals in all cases

original commit: 35ef2f90ebef94c8f7c4e46fc43c03b6ce329a41
2014-02-19 16:40:40 -05:00
Asumu Takikawa
088e5d700f Enable mixed type annotations for define
original commit: 3d177e454ea3634060a4b9b0814f588bc7c74e49
2014-02-19 16:40:40 -05:00
Asumu Takikawa
5cfd64eb33 Support polymorphism in both TR let and lambda
original commit: 967490cb229c3ef4d70960f6b0075d8e28f21ea9
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ca951c418c Add :-less versions of struct macros
original commit: 45d36579d3823f024a7448ed9efc552aa90b9b0f
2014-02-19 16:40:40 -05:00
Asumu Takikawa
861d303db5 Add a :-less do for TR
original commit: a941f95c2e117829b729d75f815c868630a5869f
2014-02-19 16:40:40 -05:00
Asumu Takikawa
b5f3811937 Make :-less versions of let variants in TR
original commit: e6e3ab4e74f95585d01ae66df048ee6ee76088b1
2014-02-19 16:40:40 -05:00
Asumu Takikawa
6ffd6fc72c Add support for rest arguments in TR plain lambda
Two caveats:
  * in some positions : is not accepted as a formal
    when used in combination with * as a formal
  * the quality of parse error messages for rest
    argument types is traded for better optional argument
    error messages

original commit: a3d818c748b09dd07043460ad412a19d0f94b47c
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ca0c7f3f35 Better error messages for TR lambda parsing
original commit: ad4f6e1ea1f9c0e2e7ca30e6ea6d8c6e8a50f0ca
2014-02-19 16:40:40 -05:00
Asumu Takikawa
f1fbe180e2 Incorporate PR feedback
original commit: aef37edae4fdeea89960bdaff6abe7d474e91218
2014-02-19 16:40:40 -05:00
Asumu Takikawa
ad79633b49 Improve type-checker for optional arg functions
original commit: eb7a0f87974f9bdeba8819cfbd7899773eae019b
2014-02-19 16:40:40 -05:00
Asumu Takikawa
4338551c6c Allow TR lambda to have a result type annotation
original commit: 7e09362986ea09bcfd68894c83331ecc0ca7cee4
2014-02-19 16:40:39 -05:00
Asumu Takikawa
91b02494df Improve TR lambda to accommodate type annotations
The new `lambda` form allows all combinations of arguments
with optional type annotations for all cases.

original commit: 8ea32c68f61a0bfad6b162302bc3c0ff28870361
2014-02-19 16:40:39 -05:00
Asumu Takikawa
5b642ef79d Fix TR double cast bug
In some cases, TR tried to typecheck the contents of a quote-syntax
form that contains unexpanded syntax.

Closes PR 14355

original commit: 26204cf505f885827854908391d2842476728c8b
2014-02-18 23:28:49 -05:00
Asumu Takikawa
1fecbdb182 Add typed/pict which exports part of pict
Does not cover all of the bindings yet, but it
should just be a SMOP after the last extra-env-lang
feature additions.

original commit: 0c0befac075a137158c568f93397c9bea4a109b2
2014-02-18 18:43:57 -05:00
Asumu Takikawa
c8595e7e45 Improve TR's extra-env-lang
Instead of parsing the module's body like env-lang,
export a `type-environment` form instead. That way
the module may contain any auxiliary definitions
or expressions that are needed.

Additionally allow #:opaque and #:struct clauses
for opaque and struct types in the base type environment.

Update typed/syntax/stx for the new API.

original commit: db51fdb8fdc943971122fea32a7b593b187bd685
2014-02-18 18:43:57 -05:00
Vincent St-Amour
1b78da2bf6 Swap remaining unsafe and chaperone-unsafe operation in the TR optimizer.
Fixes the fix in aba046a92d42.

original commit: 1d1d8bacad035fc1609f7444dd207a92b395d5ae
2014-02-17 18:41:18 -05:00
Asumu Takikawa
720544b95c Improve type inference for ListDots
This provides better inference for the case when trying
to infer a ListDots in a negative position against a List
type. For example, when trying to apply `time-apply`.

original commit: 18adcb5b041be12994eb65d86bde5dc1f164cca7
2014-02-16 11:35:55 -05:00