Commit graph

135 commits

Author SHA1 Message Date
Zahary Karadjov
31651ecd61 allow referencing other parameters in default parameter values
fix #7756
fix #1201
fix #7000
fix #3002
fix #1046
2018-06-16 16:46:32 +03:00
Zahary Karadjov
e719f211c6 fix #6928; fix #7208 2018-06-16 16:46:32 +03:00
Zahary Karadjov
16b594b532 Support default type parameters
progress on #7516
2018-06-16 16:46:32 +03:00
Zahary Karadjov
5bcf8bcb59 fixes #7222; fixes #5595; fixes #3747
* late instantiation for the generic procs' default param values
* automatic mixin behaviour in concepts

Other fixes:

* don't render the automatically inserted default params in calls
* better rendering of tyFromExpr
2018-06-16 16:46:32 +03:00
Andreas Rumpf
669a564492 remove more global variables in the Nim compiler 2018-05-27 11:10:56 +02:00
Araq
2a7fc84c86 remove ast.emptyNode global; cleanup configuration.nim 2018-05-16 03:06:07 +02:00
Araq
02b78d3f94 make tests green again 2018-05-14 21:38:18 +02:00
Andreas Rumpf
ce859d8c16 more modules compile again 2018-05-12 16:35:59 +02:00
Araq
1d9343080d added toOpenArray builtin for zero-copy slices; syntax sugar yet to come 2018-03-24 20:26:34 +01:00
zah
121b9e26fb Static[T] fixes (#7333)
* fix the usage of unresolved static[T] parameters in proc signatures
* fix tsametype and tmacrogenerics
* Allow creating composite type classes with concepts and using them in type signatures
* Allow integers to be used in ident concatenations
* Support using imported C++ generic types in proc signatures
* fixes #7230
* closes #7379
* re-enable some metatype tests
2018-03-24 15:28:09 +01:00
Araq
8a601669ef fixes #6489 2017-11-23 02:32:51 +01:00
Andreas Rumpf
70ea45cdba deprecated unary '<' 2017-10-29 08:37:13 +01:00
Andreas Rumpf
1a61c4d46d first implementation of the 'func' keyword 2017-09-23 23:22:53 +02:00
Zahary Karadjov
f0999de9dc Fix #5962
During the instantiation of a generic type A, some other generic
type B may be instantiated multiple times with different parameters.
We can think about each instantiation as a function call that should
temporary bind the parameter names to concrete types. The problem
with the existing implementation in semtypinst was that it was
performing this binding within a shared global table. In this sense,
it was executing the code as a programming language featuring only
global variables. In such a language, re-entrant functions cannot be
defined properly and hence this was leading to problems with similar
types. The solution is simple - just like we need to introduce stack
frames to handle re-entrant functions, we introduce a stack of type
bindings that are pushed and popped during the generic instantiations.
2017-06-20 11:29:42 +02:00
Zahary Karadjov
cd02561368 introduce a pre-processing pass for the concept bodies
fixes #4982
fixes #3805

close #3414
2017-06-20 11:29:42 +02:00
Araq
4033929127 fixes tproctypecache_falsepositive.nim test case 2017-06-08 18:35:37 +02:00
Zahary Karadjov
e9a3ffbc3d Restore the Nim's 0.14 proper handling of generic aliases
A more efficient implementation is possible by restoring the old
lifting ot tyGenericInvocation to tyGenericInst in liftTypeParam,
but this fix will suffice for now.

fixes #5087
fixes #5602
fixes #5641
fixes #5570
2017-04-08 17:28:19 +03:00
Zahary Karadjov
7fdf29937d fix tgenericshardcases 2017-03-24 17:07:30 +02:00
zah
be174fc3c7 Fix generic forward declarations; fixes #4104; fixes #4908 (#5566) 2017-03-23 12:40:57 +01:00
Araq
2589d69ed2 fixes #5430 2017-02-26 00:32:07 +01:00
Andreas Rumpf
46efaf294b big compiler refactoring; avoid globals for multi method dispatcher generation 2017-02-22 16:27:52 +01:00
Araq
01c785e0aa make tests green again 2017-02-16 10:39:40 +01:00
Araq
97e26967f1 fixes #5383 2017-02-16 00:43:14 +01:00
Andreas Rumpf
abaf5d0bdb fixes #5285 2017-02-04 21:00:07 +01:00
Jacek Sieka
6f7b891bdc remove remnants of tyIter 2016-10-24 21:10:48 +08:00
Andreas Rumpf
bae3baf9cc fixes #4856 2016-10-20 15:20:27 +02:00
Andreas Rumpf
3a13706d7d fixes #4673 2016-09-01 13:02:53 +02:00
Andreas Rumpf
10f445da89 Merge pull request #4592 from arnetheduck/compiler-cleanup
Compiler cleanup
2016-08-25 16:50:54 +02:00
Andreas Rumpf
f1e4d8ed74 side-effect computation now done in the proper pass; fixes #4254 2016-08-25 16:33:51 +02:00
Jacek Sieka
3cd4cf4320 remove unused stuff 2016-08-09 22:54:27 +08:00
Andreas Rumpf
089c31765f fixes #3055 2016-07-08 20:11:59 +02:00
Andreas Rumpf
e65c89ee28 fixes #4177 2016-05-28 22:40:28 +02:00
Andreas Rumpf
8dfdea8919 fixes #4097 2016-04-19 11:56:35 +02:00
Andreas Rumpf
1afdefcbe9 added experimental .this pragma 2016-02-28 03:17:20 +01:00
Araq
86e2d6ee90 fixes #3476 2015-10-27 08:37:56 +01:00
Araq
d93507fd2e fixes #3338 2015-10-22 10:24:46 +02:00
Araq
c921f30b1d renamed inCompilesContext to compilesContextId; added test case for #3313 2015-09-18 11:29:43 +02:00
Araq
5b2f54ffa1 fixes #3313 2015-09-18 11:24:16 +02:00
Araq
36f68e1650 fixes #3329 2015-09-18 02:24:12 +02:00
Araq
612cd25d5d usage of NimNode triggers .compileTime context; fixes #1679 2015-09-14 12:41:49 +02:00
Araq
c27019f4d9 fixes generic instantations in concepts 2015-09-12 19:40:08 +02:00
Andreas Rumpf
b3abcaf9e8 Merge pull request #3177 from zah/generic-types-in-macros
Generic types in macros
2015-08-14 01:51:25 +02:00
Araq
35f8cc0bdd fixes #2752 2015-08-09 20:29:03 +02:00
Zahary Karadjov
02f97489b7 fix #1858 again; restores the support for static macro params 2015-08-02 23:58:22 +03:00
Araq
26eae7d00e fixes #2470, fixes #1354 2015-04-28 20:21:53 +02:00
Araq
d89a20cc1d fixes #2509 2015-04-11 10:01:10 +02:00
Araq
4d8cd34c9e fixes #794 2015-03-07 15:43:35 +01:00
Araq
f2cdbc92eb fixes #2215 2015-02-25 20:32:32 +01:00
Araq
b7f11b8b0a fixes #2125 2015-02-18 13:44:01 +01:00
Federico Ceratto
c95f6f117a Fix typos 2015-02-15 16:06:06 +00:00