summary refs log tree commit diff stats
path: root/tests/objects
Commit message (Expand)AuthorAgeFilesLines
* fixes #17437 - crash where error reporting > 1 (#17547)Saem Ghani2021-03-291-0/+22
* remove some noises in tests (#16448)flywind2020-12-271-7/+3
* testament: error instead of silently ignore invalid targets; remove pointless...Timothee Cour2020-12-141-1/+1
* make megatest consistent with unjoined tests wrt newlines, honor newlines in ...Timothee Cour2020-11-281-1/+1
* close #4318(add testcase for #4318) (#15904)flywind2020-11-111-0/+12
* fix #14698 nkRecWhen caused internalAssert in semConstructFields when generic...Timothee Cour2020-07-271-0/+20
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-1/+1
* implement (#14114)cooldome2020-04-251-0/+6
* Turn some of the errors back into warningsZahary Karadjov2020-04-011-1/+1
* fix when statements in inheritable generic objects (#13667) [backport]Jasper Jenkins2020-03-171-0/+11
* Revert "printing float values will have one more digit. (#13276) [backport]" ...Timothee Cour2020-02-081-3/+3
* printing float values will have one more digit. (#13276) [backport]Arne Döring2020-02-071-3/+3
* Fixed objects being erroneously zeroed out before object construction (#12814...Neelesh Chandola2019-12-051-0/+22
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
* Remove ENDB (#12095)Clyybber2019-08-311-1/+0
* Remove immediate pragma (#11308)Arne Döring2019-05-291-1/+1
* add tests, closes #3012, closes #7244narimiran2019-02-271-0/+21
* fixes #10195Araq2019-02-191-0/+5
* 32 bit fixes (#10608)Arne Döring2019-02-131-27/+1
* disable one more test for C++Araq2019-01-161-0/+4
* fixes #10203 (#10290)Andreas Rumpf2019-01-151-0/+20
* void object fields are now ignored by codegen and fields/fieldPairs iterator ...Neelesh Chandola2019-01-101-0/+17
* Merge pull request #8748 from LemonBoy/when-in-objectsAndreas Rumpf2018-12-121-0/+51
|\
| * Pervasive replacement of nkRecWhen in generic typesLemonBoy2018-10-191-0/+51
* | megatest checks output and nimoutArne Döring2018-12-111-18/+13
* | require errormsg to be specified before file.Arne Döring2018-12-112-5/+5
* | threw away a silly testAraq2018-11-231-61/+0
* | activated more tests, allow input in test specArne Döring2018-11-231-0/+9
* | make run the default action of a test in testerArne Döring2018-11-232-1/+8
* | More descriptive names of test files (#9531)Miran2018-10-292-0/+0
* | Merge tests into a larger file (part 5 of ∞) (#9368)Miran2018-10-1611-223/+204
|/
* make tests green againAndreas Rumpf2018-07-052-3/+3
* make tests green againAndreas Rumpf2018-07-052-5/+5
* fixes #7637; assignments are not allowed to slice object; minor breaking changeAndreas Rumpf2018-04-213-13/+34
* avoid creating temporary in genObjConstr if possible (#7032)jcosborn2018-01-112-1/+13
* Improved collection-to-string behavior (#6825)Fabian Keller2017-12-141-10/+10
* fixes #6294Araq2017-09-051-1/+37
* Fix typo (#6236)Daniil Yarancev2017-08-121-1/+1
* Remove expr/stmt (#5857)Arne Döring2017-07-251-1/+1
* fixes #5892Araq2017-07-171-0/+19
* fixes #4763Araq2017-07-171-0/+32
* fixes #4673Andreas Rumpf2016-09-011-0/+13
* make test green again (code was wrong, but not detected by compiler)Andreas Rumpf2016-04-301-1/+1
* fixes regression: tobjconstr2 test works againAraq2015-10-141-1/+1
* fix test failure due to "illegal recursion" error messageAman Gupta2015-10-011-1/+1
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-047-17/+17
* fixes #3038Araq2015-07-031-0/+28
* renamed writeln to writeLine in testspatrick dw2015-06-192-13/+13
* fixes #1658Araq2015-04-111-0/+15
* fixes #1691Araq2015-04-111-0/+7
pan> ^
7d17cd34b ^
50e98e6ef ^
e1702ae1e ^
e68a6ea75 ^
3d5f10f0d ^
c7c6b13a3 ^
ea475a4e9 ^
3d5f10f0d ^
955040f0f ^
691026f50 ^
2c5b36700 ^
3d5f10f0d ^
691026f50 ^

cf78c02b7 ^
1e635bb53 ^
57574eaf3 ^
2f6e06d22 ^
4503fa542 ^
2f6e06d22 ^
0ef830577 ^
f562a5c55 ^


e1702ae1e ^
691026f50 ^





5a14b9ea1 ^

2f6e06d22 ^
15f0b4867 ^
3d5f10f0d ^


da267911e ^
538b8d403 ^
2147b116a ^




c8000b102 ^
ebb1b7af2 ^
ea0e45e62 ^
0b1989d73 ^
5a14b9ea1 ^
4a38092ac ^
e1702ae1e ^

3d5f10f0d ^
944e4cf58 ^

e1702ae1e ^

f4af9e955 ^




e1702ae1e ^

fe791c67b ^
8e8231f9d ^
e1702ae1e ^
b2b878f4d ^
e1702ae1e ^
8e8231f9d ^
b70fd0400 ^
5163fe7d8 ^
691026f50 ^
efd5c571b ^
691026f50 ^
af140966e ^
61d682e73 ^


5c510a9ab ^


691026f50 ^






























01ad0cdc5 ^
d1d141b13 ^




c8000b102 ^
538b8d403 ^

c8000b102 ^
538b8d403 ^


d1d141b13 ^
a95b6391f ^



76763f51a ^



7d17cd34b ^
e47c3987c ^
691026f50 ^

c8000b102 ^
691026f50 ^

f77dea01f ^

51f3ef6cb ^
944e4cf58 ^
800cb006e ^
691026f50 ^


50e98e6ef ^
c273496d1 ^

17acf146a ^
691026f50 ^
a236002e5 ^
908fc2a22 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
                     
 
 
                                           
                                                                                                                                                                                                                             
 


                                                         






                                                                         
                  
                 




















                                                                                 
 


                                                                                

                                

                                               




                                                                                       

                                                            
                                                               




                                                                                                                                                        
 
                                                                                                         

                                 
                                                                         
 
                                                                 








                                                                                                                                       

                                                                       
 
                                                                                                                      

                             

                                    

                                                                           
 

                                         


                                                        


                                                         


                                                                                                         
                                         
 
                  
                             
                                                                  
                                                
                                                                           
                                                                                                  
                                                                                                                                  
                                                               
                                                                                                       
                                                                                                   

                                                                                 
                                          
                                    
                                                                             
                                                                                             
                                       
 
 


                                                                                                                          
                    





                                                                                            

                                                                                                        
                                                                                 
                                                                    


                                                                                                                                 
                                                                                                            
                                                                 




                                                                                
                                                                                                                               
                                                                                                                         
                                                                                  
                                                                               
                                                
 

                                     
                        

                                                                                   

                   




                                             

                                                                                       
                                                     
                                    
                                         
                                                                                                     
                                                        
 
                   
 
                                                                                                                                                          
                                                             
                                                                                                                              
                                                                                            


                                                                            


                                                                             






























                                                                                                             
 




                                                                             
 

                                                                                                                                               
 


                                                         
 



                                                                             



                                                                                                                                                                 
                   
 

                                                                                        
 

                                                                                 

                                                                                                  
 
                                                                                               
 


                                                                                                  
 

                                                                        
 
               
 


                                                                                              
# v2.0.0 - yyyy-mm-dd


## Changes affecting backward compatibility
- `httpclient.contentLength` default to `-1` if the Content-Length header is not set in the response, it followed Apache HttpClient(Java), http(go) and .Net HttpWebResponse(C#) behavior. Previously it raised `ValueError`.

- `addr` is now available for all addressable locations,
  `unsafeAddr` is now deprecated and an alias for `addr`.

- Certain definitions from the default `system` module have been moved to
  the following new modules:

  - `std/syncio`
  - `std/assertions`
  - `std/formatfloat`
  - `std/objectdollar`
  - `std/widestrs`
  - `std/threads`

  In the future, these definitions will be removed from the `system` module,
  and their respective modules will have to be imported to use them.
  Currently, to make these imports required, the `-d:nimPreviewSlimSystem` option
  may be used.

- Enabling `-d:nimPreviewSlimSystem` also removes the following deprecated
  symbols in the `system` module:
  - Aliases with `Error` suffix to exception types that have a `Defect` suffix
    (see [exceptions](https://nim-lang.org/docs/exceptions.html)):
    `ArithmeticError`, `DivByZeroError`, `OverflowError`,
    `AccessViolationError`, `AssertionError`, `OutOfMemError`, `IndexError`,
    `FieldError`, `RangeError`, `StackOverflowError`, `ReraiseError`,
    `ObjectAssignmentError`, `ObjectConversionError`, `FloatingPointError`,
    `FloatOverflowError`, `FloatUnderflowError`, `FloatInexactError`,
    `DeadThreadError`, `NilAccessError`
  - `addQuitProc`, replaced by `exitprocs.addExitProc`
  - Legacy unsigned conversion operations: `ze`, `ze64`, `toU8`, `toU16`, `toU32`
  - `TaintedString`, formerly a distinct alias to `string`
  - `PInt32`, `PInt64`, `PFloat32`, `PFloat64`, aliases to
    `ptr int32`, `ptr int64`, `ptr float32`, `ptr float64`

- Enabling `-d:nimPreviewSlimSystem` removes the import of `channels_builtin` in
  in the `system` module.

- The `gc:v2` option is removed.

- The `mainmodule` and `m` options are removed.

- The `threads:on` option is now the default.

- Optional parameters in combination with `: body` syntax (RFC #405) are now opt-in via
  `experimental:flexibleOptionalParams`.

- Automatic dereferencing (experimental feature) is removed.

- The `Math.trunc` polyfill for targeting Internet Explorer was
  previously included in most JavaScript output files.
  Now, it is only included with `-d:nimJsMathTruncPolyfill`.
  If you are targeting Internet Explorer, you may choose to enable this option
  or define your own `Math.trunc` polyfill using the [`emit` pragma](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma).
  Nim uses `Math.trunc` for the division and modulo operators for integers.

- `shallowCopy` and `shallow` are removed for ARC/ORC. Use `move` when possible or combine assignment and
`sink` for optimization purposes.

- The `nimPreviewDotLikeOps` define is going to be removed or deprecated.

- The `{.this.}` pragma, deprecated since 0.19, has been removed.
- `nil` literals can no longer be directly assigned to variables or fields of `distinct` pointer types. They must be converted instead.
  ```nim
  type Foo = distinct ptr int

  # Before:
  var x: Foo = nil
  # After:
  var x: Foo = Foo(nil)
  ```
- Removed two type pragma syntaxes deprecated since 0.20, namely
  `type Foo = object {.final.}`, and `type Foo {.final.} [T] = object`.

- [Overloadable enums](https://nim-lang.github.io/Nim/manual.html#overloadable-enum-value-names) and Unicode Operators
  are no longer experimental.

- Removed the `nimIncrSeqV3` define.

- `macros.getImpl` for `const` symbols now returns the full definition node
  (as `nnkConstDef`) rather than the AST of the constant value.

- Lock levels are deprecated, now a noop.

- ORC is now the default memory management strategy. Use
  `--mm:refc` for a transition period.

- `strictEffects` are no longer experimental.
  Use `legacy:laxEffects` to keep backward compatibility.

- The `gorge`/`staticExec` calls will now return a descriptive message in the output
  if the execution fails for whatever reason. To get back legacy behaviour use `-d:nimLegacyGorgeErrors`.

## Standard library additions and changes

[//]: # "Changes:"
- OpenSSL 3 is now supported.
- `macros.parseExpr` and `macros.parseStmt` now accept an optional
  filename argument for more informative errors.
- Module `colors` expanded with missing colors from the CSS color standard.
  `colPaleVioletRed` and `colMediumPurple` have also been changed to match the CSS color standard.
- Fixed `lists.SinglyLinkedList` being broken after removing the last node ([#19353](https://github.com/nim-lang/Nim/pull/19353)).
- The `md5` module now works at compile time and in JavaScript.
- `std/smtp` sends `ehlo` first. If the mail server does not understand, it sends `helo` as a fallback.
- Changed `mimedb` to use an `OrderedTable` instead of `OrderedTableRef` to support `const` tables.
- `strutils.find` now uses and defaults to `last = -1` for whole string searches,
  making limiting it to just the first char (`last = 0`) valid.
- `random.rand` now works with `Ordinal`s.
- Undeprecated `os.isvalidfilename`.
- `std/oids` now uses `int64` to store time internally (before it was int32).
- `std/uri.Uri` dollar `$` improved, precalculates the `string` result length from the `Uri`.
- `std/uri.Uri.isIpv6` is now exported.


- `std/net.IpAddress` dollar `$` improved, uses a fixed capacity for the `string` result based from the `IpAddressFamily`.


[//]: # "Additions:"
- Added ISO 8601 week date utilities in `times`:
  - Added `IsoWeekRange`, a range type for weeks in a week-based year.
  - Added `IsoYear`, a distinct type for a week-based year in contrast to a regular year.
  - Added a `initDateTime` overload to create a datetime from an ISO week date.
  - Added `getIsoWeekAndYear` to get an ISO week number and week-based year from a datetime.
  - Added `getIsoWeeksInYear` to return the number of weeks in a week-based year.
- Added new modules which were part of `std/os`:
  - Added `std/oserrors` for OS error reporting. Added `std/envvars` for environment variables handling.
  - Added `std/paths`, `std/dirs`, `std/files`, `std/symlinks` and `std/appdirs`.
- Added `sep` parameter in `std/uri` to specify the query separator.
- Added bindings to [`Array.shift`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift)
  and [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/queueMicrotask)
  in `jscore` for JavaScript targets.
- Added `UppercaseLetters`, `LowercaseLetters`, `PunctuationChars`, `PrintableChars` sets to `std/strutils`.
- Added `complex.sgn` for obtaining the phase of complex numbers.
- Added `insertAdjacentText`, `insertAdjacentElement`, `insertAdjacentHTML`,
  `after`, `before`, `closest`, `append`, `hasAttributeNS`, `removeAttributeNS`,
  `hasPointerCapture`, `releasePointerCapture`, `requestPointerLock`,
  `replaceChildren`, `replaceWith`, `scrollIntoViewIfNeeded`, `setHTML`,
  `toggleAttribute`, and `matches` to `std/dom`.
- Added [`jsre.hasIndices`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/hasIndices)
- Added `capacity` for `string` and `seq` to return the current capacity, see https://github.com/nim-lang/RFCs/issues/460
- Added `openArray[char]` overloads for `std/parseutils` allowing more code reuse.
- Added `openArray[char]` overloads for `std/unicode` allowing more code reuse.
- Added `safe` parameter to `base64.encodeMime`.

[//]: # "Deprecations:"
- Deprecated `selfExe` for Nimscript.
- Deprecated `std/sums`.
- Deprecated `std/base64.encode` for collections of arbitrary integer element type.
  Now only `byte` and `char` are supported.

[//]: # "Removals:"
- Removed deprecated module `parseopt2`.
- Removed deprecated module `sharedstrings`.
- Removed deprecated module `dom_extensions`.
- Removed deprecated module `LockFreeHash`.
- Removed deprecated module `events`.
- Removed deprecated `oids.oidToString`.
- Removed define `nimExperimentalAsyncjsThen` for `std/asyncjs.then` and `std/jsfetch`.
- Removed deprecated `jsre.test` and `jsre.toString`.
- Removed deprecated `math.c_frexp`.
- Removed deprecated `` httpcore.`==` ``.
- Removed deprecated `std/posix.CMSG_SPACE` and `std/posix.CMSG_LEN` that takes wrong argument types.
- Removed deprecated `osproc.poDemon`, symbol with typo.

## Language changes

- [Tag tracking](https://nim-lang.github.io/Nim/manual.html#effect-system-tag-tracking) supports the definition of forbidden tags by the `.forbids` pragma
  which can be used to disable certain effects in proc types.
- [Case statement macros](https://nim-lang.github.io/Nim/manual.html#macros-case-statement-macros) are no longer experimental,
  meaning you no longer need to enable the experimental switch `caseStmtMacros` to use them.
- Full command syntax and block arguments i.e. `foo a, b: c` are now allowed
  for the right-hand side of type definitions in type sections. Previously
  they would error with "invalid indentation".
- `defined` now accepts identifiers separated by dots, i.e. `defined(a.b.c)`.
  In the command line, this is defined as `-d:a.b.c`. Older versions can
  use accents as in ``defined(`a.b.c`)`` to access such defines.
- [Macro pragmas](https://nim-lang.github.io/Nim/manual.html#userminusdefined-pragmas-macro-pragmas) changes:
  - Templates now accept macro pragmas.
  - Macro pragmas for var/let/const sections have been redesigned in a way that works
    similarly to routine macro pragmas. The new behavior is documented in the
    [experimental manual](https://nim-lang.github.io/Nim/manual_experimental.html#extended-macro-pragmas).
  - Pragma macros on type definitions can now return `nnkTypeSection` nodes as well as `nnkTypeDef`,
    allowing multiple type definitions to be injected in place of the original type definition.

    ```nim
    import macros
    macro multiply(amount: static int, s: untyped): untyped =
      let name = $s[0].basename
      result = newNimNode(nnkTypeSection)
      for i in 1 .. amount:
        result.add(newTree(nnkTypeDef, ident(name & $i), s[1], s[2]))
    type
      Foo = object
      Bar {.multiply: 3.} = object
        x, y, z: int
      Baz = object
    # becomes
    type
      Foo = object
      Bar1 = object
        x, y, z: int
      Bar2 = object
        x, y, z: int
      Bar3 = object
        x, y, z: int
      Baz = object
    ```

- Redefining templates with the same signature implicitly was previously
  allowed to support certain macro code. A `{.redefine.}` pragma has been
  added to make this work explicitly, and a warning is generated in the case
  where it is implicit. This behavior only applies to templates, redefinition
  is generally disallowed for other symbols.

- A new form of type inference called [top-down inference](https://nim-lang.github.io/Nim/manual_experimental.html#topminusdown-type-inference)
  has been implemented for a variety of basic cases. For example, code like the following now compiles:

  ```nim
  let foo: seq[(float, byte, cstring)] = @[(1, 2, "abc")]
  ```

- `cstring` is now accepted as a selector in `case` statements, removing the
  need to convert to `string`. On the JS backend, this is translated directly
  to a `switch` statement.

- Nim now supports `out` parameters and ["strict definitions"](https://nim-lang.github.io/Nim/manual_experimental.html#strict-definitions-and-nimout-parameters).
- Nim now offers a [strict mode](https://nim-lang.github.io/Nim/manual_experimental.html#strict-case-objects) for `case objects`.


## Compiler changes

- The `gc` switch has been renamed to `mm` ("memory management") in order to reflect the
  reality better. (Nim moved away from all techniques based on "tracing".)

- Defines the `gcRefc` symbol which allows writing specific code for the refc GC.

- `nim` can now compile version 1.4.0 as follows: `nim c --lib:lib --stylecheck:off compiler/nim`,
  without requiring `-d:nimVersion140` which is now a noop.

- `--styleCheck`, `--hintAsError` and `--warningAsError` now only apply to the current package.

- The switch `--nimMainPrefix:prefix` has been added to add a prefix to the names of `NimMain` and
  related functions produced on the backend. This prevents conflicts with other Nim
  static libraries.

- When compiling for Release the flag `-fno-math-errno` is used for GCC.


## Tool changes

- Nim now supports Nimble version 0.14 which added support for lock-files. This is done by
  a simple configuration change setting that you can do yourself too. In `$nim/config/nim.cfg`
  replace `pkgs` by `pkgs2`.