Commit graph

542 commits

Author SHA1 Message Date
Zahary Karadjov
8682ed9bd0 pass-through of static int generic params to arrays when late instantiation is disabled 2013-08-23 01:10:20 +03:00
Zahary Karadjov
fee2a7ecfa Experimental support for delayed instantiation of generics
This postpones the semantic pass over the generic's body until
the generic is instantiated. There are several pros and cons for
this method and the capabilities that it enables may still be possible
in the old framework if we teach it a few new trick. Such an attempt
will follow in the next commits.

pros:
1) It allows macros to be expanded during generic instantiation that
will provide the body of the generic. See ``tmacrogenerics``.
2) The instantiation code is dramatically simplified. Dealing with unknown
types in the generic's body pre-pass requires a lot of hacky code and error
silencing in semTypeNode. See ``tgenericshardcases``.

cons:
1) There is a performance penalty of roughly 5% when bootstrapping.
2) Certain errors that used to be detected in the previous pre-pass won't
be detected with the new scheme until instantiation.
2013-08-23 01:10:20 +03:00
Zahary Karadjov
ca3a4ce672 hacky fix for generic constraints matching 2013-08-19 01:48:25 +03:00
Zahary Karadjov
3e79e9f981 some steps to improve the type mismatches with the new
generic instantiation logic
2013-08-19 01:45:16 +03:00
Zahary Karadjov
f760bc243b Revert "Revert "static and default params for generics""
This reverts commit 0662ec4a43.
2013-08-19 01:29:37 +03:00
Araq
aa88e150da 'modules' module from 'main'; minor bugfixes 2013-07-20 20:17:23 +02:00
Araq
ed56b8c173 fixes #442 2013-06-27 08:06:55 +02:00
Araq
d4c91bbd85 improvements for 'not nil' checking 2013-06-13 01:40:11 +02:00
Araq
865a43050d fixes #385 2013-06-03 01:21:21 +02:00
Araq
0662ec4a43 Revert "static and default params for generics"
This reverts commit 46813bbe4e.
2013-05-27 23:18:38 +02:00
Zahary Karadjov
46813bbe4e static and default params for generics 2013-05-26 13:59:39 +03:00
Araq
8fd274038e fixes #119 2013-05-18 11:52:43 +02:00
Zahary Karadjov
289c975d85 fixes #430 2013-05-12 21:55:55 +03:00
Zahary Karadjov
b3103c4657 fixes #429 and tstmtexpr 2013-05-12 21:01:39 +03:00
Zahary Karadjov
3f1e9b3a25 Merge branch 'master' of gh:/Araq/Nimrod into upstream 2013-05-04 17:50:38 +03:00
Araq
3cb3813eed fixes #287; bugfix: subrange checking is performed again 2013-04-12 16:24:58 +02:00
Araq
3051c52f51 fixes a long-standing bug about procvar checking 2013-03-25 01:44:52 +01:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
5b0d8246f7 make some tests green 2013-03-03 12:05:03 +01:00
Araq
eebee0eff2 lazy operand sem'checking (beware) 2013-03-02 20:23:56 +01:00
Zahary Karadjov
0774af169b containerID is no longer needed for generics 2013-03-01 12:12:53 +02:00
Araq
d13bcf6575 better overloading resolution for generics 2013-02-28 21:28:19 +01:00
Araq
f280ed1560 implements #295 2013-01-08 16:30:26 +01:00
Araq
a22c1f444f fixes #271 2012-12-15 22:35:16 +01:00
Araq
a1f6779802 implemented AST based overloading 2012-12-06 08:45:18 +01:00
Araq
38ab30d153 implemented generic converters 2012-12-05 22:03:36 +01:00
Araq
0834224070 disable SSLv2_method for ubuntu 2012-12-03 21:48:12 +01:00
Araq
dd9ad9e497 next steps for first class iterators 2012-11-26 02:43:32 +01:00
Araq
ccd2934e4a first steps for 'not nil' annotation 2012-11-25 11:03:14 +01:00
Araq
9f38ff0c65 next steps for exception tracking 2012-11-03 15:57:12 +01:00
Araq
de338526ec caas barely works now 2012-10-24 01:13:44 +02:00
Zahary Karadjov
3c9e3a6a71 Improved support for nkSymChoices in type coercions
For example, this allows you to pick up a proc with a specific signature from
an overload set.

bugfix: nimrod generated invalid code when a RVO function had a single
compile-time param

bugfix: nkHiddenDerefs were not neutralised properly for indirect proc calls
2012-10-15 21:00:29 +03:00
Zahary Karadjov
4ef96a7435 fixes #211
transf: fix a clang compilation error when lineDir:on is used
2012-10-13 23:31:27 +03:00
Araq
ffcbe19cd8 fixes #217 2012-10-13 01:59:20 +02:00
Zahary Karadjov
d9d82fb0af syntax compatibility between do blocks and stmt blocks
See the section `do notation` in the manual for more info.

* nkMacroStmt has been removed
   Macro statements are now mapped to regular nkCall nodes.
   The support for additional clauses (such as else, except, of, etc)
   have been restored - they will now appear as additional arguments
   for the nkCall node (as nkElse, nkExcept, etc nodes)

* fixed some regressions in the `is` operator and semCompiles
2012-10-04 15:37:26 +03:00
Zahary Karadjov
9c8bc3a244 the is operator now works with type classes and type variables
bugfixes:
the DLL tests were failing on Mac OS X, due to an incorrect DynlibFormat
2012-10-03 01:59:49 +03:00
Zahary Karadjov
7e44015491 implemented return type inference
Other fixes:
* bind once is now the default for type classes as documented in the manual
* fixes an issue in template overloading (erroneous  ambiguity when different typedesc params were used)
2012-10-03 01:59:49 +03:00
Zahary Karadjov
badb6c0f66 improved support for typedesc values
* can be stored in constants and variables (including in containers like sequences)
* can be passed to and returned from macros
2012-09-25 02:03:15 +03:00
Zahary Karadjov
27dc9fcb8f fixes #186 and the ttypedesc1 test case 2012-09-23 19:34:20 +03:00
Zahary Karadjov
b2814df5cd fixed incorrect implicit conversion between arrays of different sizes; see #202 2012-09-13 03:03:12 +03:00
Araq
1786e30991 first steps towards term rewriting macros 2012-08-30 10:55:40 +02:00
Araq
6bcdb9c8f4 implemented generic templates 2012-08-27 01:59:14 +02:00
Araq
b5b5e6e76d distinguish properly between nkOpen and nkClosedSymChoice 2012-08-26 02:47:17 +02:00
Araq
0171566c98 openarray/varargs split; breaks bootstrapping 2012-08-16 08:34:33 +02:00
Araq
1215193010 bugfix: typo in actors.nim 2012-08-15 08:13:31 +02:00
Araq
51de278bd4 next steps for tyVarargs/tyOpenArray split 2012-08-14 08:44:26 +02:00
Araq
c7158af752 idetools: 'usages' and 'def' should work now; documented js backend 2012-08-05 12:33:23 +02:00
Araq
79aaf213d6 idetools improvements 2012-08-03 17:33:44 +02:00
Araq
7d6500f1de idetools improvements; preparation of first class iterators; fixes #183 2012-08-02 23:14:38 +02:00
Araq
674c05f426 made compiler more robust for idetools; implemented idetools.usages 2012-07-30 23:07:19 +02:00