summary refs log tree commit diff stats
path: root/tests/proc
Commit message (Collapse)AuthorAgeFilesLines
* don't use previous bindings of `auto` for routine return types (#23207)metagn2024-01-171-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #23200, fixes #18866 #21065 made it so `auto` proc return types remained as `tyAnything` and not turned to `tyUntyped`. This had the side effect that anything previously bound to `tyAnything` in the proc type match was then bound to the proc return type, which is wrong since we don't know the proc return type even if we know the expected parameter types (`tyUntyped` also [does not care about its previous bindings in `typeRel`](https://github.com/nim-lang/Nim/blob/ab4278d2179639f19967431a7aa1be858046f7a7/compiler/sigmatch.nim#L1059-L1061) maybe for this reason). Now we mark `tyAnything` return types for routines as `tfRetType` [as done for other meta return types](https://github.com/nim-lang/Nim/blob/18b5fb256d4647efa6a64df451d37129d36e96f3/compiler/semtypes.nim#L1451), and ignore bindings to `tyAnything` + `tfRetType` types in `semtypinst`. On top of this, we reset the type relation in `paramTypesMatch` only after creating the instantiation (instead of trusting `isInferred`/`isInferredConvertible` before creating the instantiation), using the same mechanism that `isBothMetaConvertible` uses. This fixes the issues as well as making the disabled t15386_2 test introduced in #21065 work. As seen in the changes for the other tests, the error messages give an obscure `proc (a: GenericParam): auto` now, but it does give the correct error that the overload doesn't match instead of matching the overload pre-emptively and expecting a specific return type. tsugar had to be changed due to #16906, which is the problem where `void` is not inferred in the case where `result` was never touched.
* some test cleanups & category reorganization (#22010)metagn2023-06-0610-0/+406
| | | | | | | | | | | | | | | | | * clean up some test categories * mention exact slice issue * magics into system * move trangechecks into overflow * move tmemory to system * try fix CI * try fix CI * final CI fix
* warn against `a, b = val` in routine arguments (#21604)metagn2023-04-061-10/+6
| | | closes https://github.com/nim-lang/RFCs/issues/480
* document general use of `_`, error message, fixes (#21584)metagn2023-03-301-0/+13
| | | | | | | | | | | | * document general use of `_`, error message, fixes fixes #20687, fixes #21435 Documentation and changelog updated to clarify new universal behavior of `_`. Also new error message for attempting to use `_`, new tests, and fixes with overloadable symbols and implicit generics. * add test for #21435
* fixes #19795; fixes #11852; fixes #19974; remove parsing pipeline, Nim now ↵ringabout2023-02-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parses the whole module at one time (#21379) * fixes #19795; remove parse pipeline * isScript * fixes nimscriptapi * don't touch reorder * check script * fixes tests * it seems implicit imports of system cause troubles * access the first child of `nkStmtList` * ignore comments * minor messages * perhaps increases hloLoopDetector * the module is a stmtList, which changes the errors * fixes nimdoc * fixes tlinter * fixes nim secret tests * fixes arc_misc * fixes nim secret tests again * safe; fixes one more test * GlobalError is the root cause too * fixes parsing errors * put emit types to the cfsForwardTypes section * fixes #11852; `{.push checks:off}` now works in procs * disable navigator * fixes nimdoc * add tests for JS * fixes nimsuggest
* underscores for routine parameters (#21192)metagn2023-01-081-0/+109
| | | | | | | | | * underscores for routine parameters fixes #13443, fixes #13804, refs #21121 * add changelog + more tests * support generics and ensure inferred lambdas work
* fix #15836 proc arg return type auto unexpectly match proc with concr… ↵Bung2022-12-121-1/+1
| | | | | | | | | (#21065) * fix #15836 proc arg return type auto unexpectly match proc with concrete type * fix #16244 * add test case for #12869
* Revert "fix #15836 proc arg return type auto unexpectly match proc with ↵ringabout2022-12-091-1/+1
| | | | | | | concr…" (#21057) Revert "fix #15836 proc arg return type auto unexpectly match proc with concr… (#21044)" This reverts commit 0cd9bdcf9f6802421e0d8e4c28fc732012af605e.
* fix #15836 proc arg return type auto unexpectly match proc with concr… ↵Bung2022-12-091-1/+1
| | | | | (#21044) fix #15836 proc arg return type auto unexpectly match proc with concrete type
* fix #18136 tests/proc/t17157.nim now gives SIGSEGV instead of error (#20555)Bung2022-10-131-1/+0
|
* manual: Document that comma propagates the default values of parameters (#19080)Kaushal Modi2021-11-031-0/+20
| | | | | | | | | | | | | * manual: Document that comma propagates the default values of parameters Fixes https://github.com/nim-lang/Nim/issues/15949. * Use the "bug #NNNN" comment syntax for consistency Ref: https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib > Always refer to a GitHub issue using the following exact syntax: bug for tooling.
* fix #18113 (#18124)Saem Ghani2021-05-311-0/+1
|
* close #17157 add testcase (#17531)flywind2021-03-271-0/+6
|
* Remove declPragmas from lambdas [backport:1.0] (#16966)hlaaftana2021-02-091-0/+7
| | | | | | | | | * Remove declPragmas from lambdas [backport:1.0] * add test for exportc * fix test * fix align, nodecl -> noinit
* testament spec: remove errmsg alias of errormsg (#16188)Timothee Cour2020-11-292-2/+2
|
* allow typed/untyped in magic procs (#12911)Timothee Cour2019-12-171-2/+10
|
* fixes #12033 (#12039)Arne Döring2019-08-261-2/+11
|
* fixes #10838 (#10841)cooldome2019-03-181-0/+14
| | | | | | * fixes #10838 * reject func in types instead * trigger tests
* typed/untyped return type is invalid for everything except templates and ↵Neelesh Chandola2019-01-151-0/+12
| | | | macros (#10275)
* proc does not take untyped/typed as argument (#9981)Neelesh Chandola2018-12-192-0/+14
| | | | | | * proc does not take untyped/typed as argument * Add TODO
* require errormsg to be specified before file.Arne Döring2018-12-111-2/+1
|
* Merge tests into a larger file (part 5 of ∞) (#9368)Miran2018-10-164-37/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * merge magics * merge metatype tests * merge method tests * merge objects tests * change `import future` to `import sugar` Nim in Action tests are left with `import future`, to ensure compatibility. * merge overload tests * merge proc tests * merge procvar tests * merge range tests * merge seq tests * merge sets tests * remove wrong assert from `tsets3` * fix `jsTests` * better fix
* Pick skParam symbols when resolving type idents (#8720)LemonBoy2018-08-221-0/+10
| | | Fixes #8357
* Update all the default parameters after an instantiation (#8689)LemonBoy2018-08-201-0/+11
| | | | | | The old implementation relied on the (now?) wrong assumption that default-valued parameters can only be placed after the required ones. Fixes #8683
* make tests green againAndreas Rumpf2018-05-021-2/+2
|
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-4/+4
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* new tester; all tests categorizedAraq2014-01-132-0/+25