Commit Graph

10643 Commits

Author SHA1 Message Date
Zahary Karadjov
672c24e4b8 fix affecting templates with explicit generic params 2017-05-13 20:48:44 +03:00
Zahary Karadjov
05bfa47996 fix tinvalidinout 2017-05-13 18:51:28 +03:00
Zahary Karadjov
cdb011afdc attempt to fix a compilation problem caused by nimcache 2017-05-13 15:46:47 +03:00
Zahary Karadjov
b428da2cc2 work-around for defining imported types with weak covariance 2017-05-13 15:46:08 +03:00
Zahary Karadjov
0aede22e87 enforce the covariance rules for user-defined generic types 2017-05-13 14:38:07 +03:00
Zahary Karadjov
7e0c66ffe7 manual additions for the covariant generic parameters 2017-05-12 21:27:32 +03:00
Zahary Karadjov
2106598d30 explain covariance in the manual 2017-05-12 18:43:14 +03:00
Zahary Karadjov
f4e73344d4 covariance for arrays and sequences 2017-05-12 18:42:46 +03:00
Zahary Karadjov
a802d72452 doh, forgot to add all files in the previous commit 2017-05-12 12:46:09 +03:00
Zahary Karadjov
597ea08815 covariance for generic importc types 2017-05-12 11:46:25 +03:00
Zahary Karadjov
5e368f3639 support for external types with covariant generic params 2017-05-08 21:45:37 +03:00
Zahary Karadjov
2a34552596 fix 5756 2017-04-30 22:28:20 +03:00
Zahary Karadjov
622100adb6 close #5757 2017-04-30 21:57:13 +03:00
Zahary Karadjov
9107e551f1 close #5726
Turned out that the old code was wrong. I'm not sure why it used to work.

`response.body` properly resolves to an async proc defined in the httpclient
module with the following signature:

proc body*(response: AsyncResponse): Future[string] {.async.}

Perhaps the old code was somehow matching the body field of the `AsyncResponse`
object, which is marked as private.
2017-04-28 19:09:11 +03:00
Zahary Karadjov
fa52cff826 hold back the new | operator for types as it creates mysterious problems fro tests/trmacros/tor 2017-04-28 18:38:08 +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
bc01835091 Allow tyOr,tyAnd and tyNot to be constructed in more contexts 2017-04-28 17:07:54 +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
13701c0957 Restore the compilation of linalg by tweaking the complex disambiguation rules
This commit is a potentially breaking change, but the problem was that
linalg was relying on a previous bug in the compiler, which was fixed
in the concepts branch.

With the old disambiguation rules, generic procs like:

proc \`==\`[T](lhs, rhs: T)

and

proc \`==\`(lhs, rhs: Matrix32|Matrix64)

.. were considered equal, even though it's obvious that the second one
should be preferred. We never noticed this, because there was a bug in
sigmatch incorrectly counting one of the params of the second proc as
a non-generic match, thus giving it an edge.

This commit gives some preference to tyOr and tyAnd during the complex
disambiguation, which may affect overload resolution in other cases.

I see this only as a temporary solution. With my upcoming work on
concept refinement, I plan to provide an experimental implementation
of alaternative C++-like rules for determining which proc is more specific.
We can then discuss our strategy for dealing with such a breaking change.
2017-04-16 16:11:45 +03:00
Zahary Karadjov
2da4a4fbe3 fix regression in tmatrixconcept 2017-04-16 14:39:00 +03:00
Zahary Karadjov
3571a8d2f1 more sophisticated test for the previous commit 2017-04-16 14:14:14 +03:00
Zahary Karadjov
4da8536701 fix compilation regression in alea 2017-04-16 13:42:33 +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
8de19a7f4c fix a parsing regression (do is still mandatory in some situations) 2017-04-14 23:48:43 +03:00
Zahary Karadjov
03770daba4 allow StmtLists to pass through semExprWithType
This fix was necessary in order to fix the lambda lifting used in
the "jsffi" module, which relies on turning nkStmtList into nkLambda
in a catch-all dot operator.
2017-04-11 02:22:13 +03:00
Zahary Karadjov
54a1d9c16a wip 2017-04-11 00:48:52 +03:00
Zahary Karadjov
a3f19c87fb lift parameter-less do block to lambdas 2017-04-10 23:58:05 +03:00
Zahary Karadjov
f7b10e213b support post expression blocks in return and yield 2017-04-10 17:26:50 +03:00
Zahary Karadjov
8b63b84924 fix a regression in tlexerex 2017-04-10 13:06:06 +03:00
Zahary Karadjov
8cb11aac4f adapt quote to the new parsing rules 2017-04-10 12:23:04 +03:00
Zahary Karadjov
e7eb01ed48 fix a parsing regression (calls with do inside param lists)
This treatment is applied only when "do" is used, because
the code foo(x: bar) is recognized as object construction.
2017-04-10 12:08:40 +03:00
Zahary Karadjov
9ffaee3f88 fully consisent parsing between the new and the old 'do blocks' 2017-04-10 11:44:02 +03:00
Zahary Karadjov
34b2527441 the new blocks without 'do' produce compatible AST with 'do blocks' 2017-04-09 23:45:52 +03:00
Zahary Karadjov
48a1a54d1c improve the usability of the jsffi module
* All JavaScript operators are usable with JsObject
* The dot operators will use native JavaScript strings
* Results returned from dot calls are consired discardable
2017-04-09 23:04:55 +03:00
Zahary Karadjov
987b522071 fix the do notation when used with procs 2017-04-09 22:59:24 +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
Zahary Karadjov
fceef77301 test case for #5640 2017-04-07 21:57:04 +03:00
Zahary Karadjov
0b7321651e fix #5658 2017-04-07 21:53:27 +03:00
Zahary Karadjov
e11b3520ff fix #5654 2017-04-07 19:35:05 +03:00
Zahary Karadjov
fb3ff64450 fix #5642 2017-04-07 19:28:52 +03:00
Zahary Karadjov
eb635d9ccf fix #5648 2017-04-07 17:03:49 +03:00
Zahary Karadjov
ee4b98ec17 wip fix #5640 2017-04-07 15:05:14 +03:00
Dominik Picheta
cdfcc12529 Implement json.% for enums. 2017-04-06 21:56:20 +02:00
Dominik Picheta
28f3b3d3a7 Add some extra methods and fields to DOM module. 2017-04-06 21:16:17 +02:00
zah
0c694d2064 Merge pull request #5564 from nim-lang/fix/4556
Fix/4556
2017-04-06 11:25:19 +03:00