Commit Graph

128 Commits

Author SHA1 Message Date
Araq
c1a6ebf40d closes #6220
(cherry picked from commit c64391e30b)
2018-11-01 17:51:16 +01:00
Miran
a65ac85e4a make some tests faster (#9413)
* remove duplicated slow test

* smaller `convex hull`

* smaller sleep

* faster `trtree`

* smaller sleep in `tfuturestream`

(cherry picked from commit 95504caa31)
2018-11-01 17:48:56 +01:00
Miran
325ca8cae6 Merge tests into a larger file (part 3 of ∞: generics) (#9347)
* merge generics issues tests
* merge tgeneric
* merge test with local imports
* merge tcan tests
* merge matcher tests
* more issue tests merged
* one more tcan test
* merge various small tests into one file
* add a test for #3717

(cherry picked from commit 9f8b93641e)
2018-11-01 17:37:48 +01:00
Vindaar
ed4a7b7f66 add issue #5707 as test case (#9361)
(cherry picked from commit afd5abdfc2)
2018-11-01 17:37:33 +01:00
Timothee Cour
b0618ffe17 fix tests/generics/t8694.nim: runnableExamples were not run because of #9216 (#9262)
(cherry picked from commit 63c00d7be9)
2018-11-01 17:28:26 +01:00
LemonBoy
6d4503325c Fix regression with runnableExamples in generic expr
The examples should not enter the generic analysis at all.
The regression was introduced in 4cf704bb as a fix for #8694.

Fixes #9130
Fixes #8694
2018-09-30 14:11:53 +02:00
Araq
5ee904643a fixes #8883 2018-09-14 15:47:37 +02:00
Araq
e98e214422 fixes #7854 2018-08-30 15:49:51 +02:00
Andreas Rumpf
96e0b56a55 make generic tests green again 2018-08-13 12:54:02 +02:00
Andreas Rumpf
404de2f23e Merge branch 'devel' into araq-misc 2018-08-10 12:06:16 +02:00
Mamy Ratsimbazafy
bccaa36aba Tests for v1 closed generics/static issues (#8572)
* Add tests to confirm https://github.com/nim-lang/Nim/issues/7231 is fixed.

* Add test for closed https://github.com/nim-lang/Nim/issues/6137

* Add test for https://github.com/nim-lang/Nim/issues/7141
2018-08-08 17:49:33 +02:00
Araq
00ef2d6693 make test green again 2018-08-08 15:43:05 +02:00
LemonBoy
c3a9ac4d35 Try conversion to static[T] in generic instantation (#8443)
Fixes #8439
2018-07-30 10:51:14 +02:00
LemonBoy
d5c9255cab Allow use of typedesc as type converters (#8409)
Fixes #8403
2018-07-24 08:25:08 +02:00
LemonBoy
9b98add6c7 Do not crash while instantiating a generic outside a call (#8279)
Fixes #8270
2018-07-14 01:44:40 +02:00
LemonBoy
c6671776a1 Reset typedescMatched before paramTypesMatch (#8250)
The flag should not be carried out across different parameters.

Fixes #7794
2018-07-09 15:02:48 +02:00
Andreas Rumpf
0926754e68 make tests green again 2018-07-05 15:51:04 +02:00
Zahary Karadjov
e719f211c6 fix #6928; fix #7208 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
Zahary Karadjov
5f2cdcd4fa fix #7653 2018-06-10 22:27:51 +03:00
LemonBoy
03653ab61e Fix type inference with static literals.
Fixes #3977
2018-06-10 14:25:40 +03:00
Zahary Karadjov
7297613900 Bugfix: The compiler were not inserting proper downcasts for generic types
This resulted in a codegen error in C++ mode, because the generic
types were not defined in modules where calls requiring downcasts
were used (generating a downcast forces the inclusion of the full
definition of the involved types).
2018-05-07 09:37:49 +02:00
Andreas Rumpf
3dab0877da fixes #7247 2018-02-23 11:42:19 +01:00
Araq
b57d14b1ae make more tests green 2018-02-10 20:55:22 +01:00
Andreas Rumpf
bd1dfa4b38 better type inference for numerical types; prerequisitive for version 1 2018-02-02 09:29:05 +01:00
Fabian Keller
6df6ec27ec Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
Andreas Rumpf
1548743856 make tests green again 2017-11-18 23:03:16 +01:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Zahary Karadjov
491162d3c8 close #5106 2017-06-20 11:29:42 +02:00
Zahary Karadjov
9edf66df85 close #5756 2017-06-20 11:29:42 +02:00
Zahary Karadjov
f713e730c8 fix #5864 2017-06-20 11:29:42 +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
Araq
4033929127 fixes tproctypecache_falsepositive.nim test case 2017-06-08 18:35:37 +02:00
Zahary Karadjov
2a34552596 fix 5756 2017-04-30 22:28:20 +03:00
Zahary Karadjov
5c678e2848 alternative fake covariance based on converters 2017-04-28 18:26:41 +03:00
Zahary Karadjov
72f42ff95f more advanced fake covariance 2017-04-28 18:01:04 +03:00
Zahary Karadjov
c981284ddc a simple way to simulate covariance in generic types 2017-04-28 17:40:57 +03:00
Zahary Karadjov
3e52bb6535 fix a regrsesion in signature matching of derived ptr types 2017-04-18 23:55:59 +03:00
Zahary Karadjov
dfbafff2e7 fix a compilation error in linalg 2017-04-16 02:44:58 +03:00
Zahary Karadjov
bf4ce87e5b fix #5689 2017-04-15 02:53:28 +03:00
Zahary Karadjov
d578815963 fix #5683 2017-04-14 23:54:09 +03:00
Zahary Karadjov
03172bef6f fix #5643; fix #5644 2017-04-08 23:42:42 +03: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
andri lim
2f9a698e87 attempt to fix #5632 typedesc typeRel regression (#5634) 2017-03-31 21:58:26 +02:00
andri lim
fce4b7cd62 attempt to fix #5621 #5615 generic ref object typeRel (#5633) 2017-03-31 21:58:09 +02:00
Zahary Karadjov
cbf66e99a8 Working test cases for the sophisticated matrix library example from the manual
Fixed the dot operator when used within return types (see tgenericdotrettype)
Fixed the matching of generic concepts aliases used with the implicit generics style
2017-03-24 16:59:47 +02:00
Andreas Rumpf
0d8a503e45 fixes #5597; wrong eager template instantiation in generic context (#5601) 2017-03-24 07:35:12 +01:00
andri lim
568c954062 fixes #5241, fixes #5411 inherit from specialized generic typeRel problem (#5573) 2017-03-23 23:39:29 +01:00
zah
be174fc3c7 Fix generic forward declarations; fixes #4104; fixes #4908 (#5566) 2017-03-23 12:40:57 +01:00
mfxmfx
8699372109 Correct the spelling of the word 'overridden'. (#5212) 2017-01-11 13:40:10 +01:00