summary refs log tree commit diff stats
path: root/tests/misc
Commit message (Collapse)AuthorAgeFilesLines
* Show error when trying to run in folder that doesn't exist instead of ↵Jake Leahy2024-01-231-0/+6
| | | | | | | assertion (#23242) Closes #23240 Fixes regression caused by #23017
* don't use previous bindings of `auto` for routine return types (#23207)metagn2024-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* delay resolved procvar check for proc params + acknowledge unresolved ↵metagn2024-01-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | statics (#23188) fixes #23186 As explained in #23186, generics can transform `genericProc[int]` into a call `` `[]`(genericProc, int) `` which causes a problem when `genericProc` is resemmed, since it is not a resolved generic proc. `[]` needs unresolved generic procs since `mArrGet` also handles explicit generic instantiations, so delay the resolved generic proc check to `semFinishOperands` which is intentionally not called for `mArrGet`. The root issue for [t6137](https://github.com/nim-lang/Nim/blob/devel/tests/generics/t6137.nim) is also fixed (because this change breaks it otherwise), the compiler doesn't consider the possibility that an assigned generic param can be an unresolved static value (note the line `if t.kind == tyStatic: s.ast = t.n` below the change in sigmatch), now it properly errors that it couldn't instantiate it as it would for a type param. ~~The change in semtypinst is just for symmetry with the code above it which also gives a `cannot instantiate` error, it may or may not be necessary/correct.~~ Now removed, I don't think it was correct. Still possible that this has unintended consequences.
* fixes #22844; uses arrays to store holeyenums for iterations; much more ↵ringabout2023-10-201-0/+16
| | | | | efficient than sets and reasonable for holeyenums (#22845) fixes #22844
* Add test case for #15351 (#22754)Jake Leahy2023-09-261-0/+5
| | | | | Closes #15351 Stumbled across the issue and found it now works
* produce better code for object constructions and 'result' [backport] (#22668)Andreas Rumpf2023-09-111-4/+7
|
* add test for #3907 (#21069)Bung2023-08-061-0/+10
| | | * add test for #3907
* fix #20883 Unspecified generic on default value segfaults the compiler (#21172)Bung2023-08-041-0/+12
| | | | | | | | | * fix #20883 Unspecified generic on default value segfaults the compiler * fallback to isGeneric * change to closer error * Update t20883.nim
* fixes CI; disable SSL tests on osx for now (#22304)ringabout2023-07-221-0/+1
| | | | | * test CI * disable osx
* some test cleanups & category reorganization (#22010)metagn2023-06-0641-1467/+1
| | | | | | | | | | | | | | | | | * 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
* properly disallow unresolved generic proc values (#22005)metagn2023-06-051-16/+0
| | | | | | | * properly disallow unresolved generic proc values * mirrors semoperand * shallow efTypeAllowed, add back special case
* fixes fieldDefect loses enum type info in ORC; consistent with VM and refc ↵ringabout2023-05-291-2/+1
| | | | | (#21954) fixes fieldDefect loses enum type info in ORC
* clean up SOME pending/xxx/issue link comments (#21826)metagn2023-05-114-25/+13
| | | | | * clean up SOME pending/xxx/issue link comments * great
* tweak spellsuggest; three counts for equal distances candidates by default ↵ringabout2023-04-211-1/+1
| | | | | | | (#21700) * tweak spellsuggest; three counts for equal distances candidates * only suggest typos when length > 3
* actually fix #19015 (#21680)metagn2023-04-171-0/+28
| | | | | | | * actually fix #19015 * more tests * round out
* int64/uint64 as bigint in JS (#21613)metagn2023-04-111-4/+16
| | | | | | | | | | | * int64/uint64 as bigint in JS * fix CI * convert to compile option * fix lie * smaller diff, changelog entry
* tuple unpacking for vars as just sugar, allowing nesting (#21563)metagn2023-03-281-3/+0
| | | | | | | | | | | | | | | | | | | * tuple unpacking for vars as just sugar, allowing nesting * set temp symbol AST * hopeful fix some issues, add test for #19364 * always use temp for consts * document, fix small issue * fix manual indentation * actually fix manual * use helper proc * don't resem temp tuple assignment
* add a prepass for codeReordering (#21513)ringabout2023-03-171-1/+0
| | | | | | | * add a prepass for codeReordering * simplify * fixes
* fixes #19795; fixes #11852; fixes #19974; remove parsing pipeline, Nim now ↵ringabout2023-02-222-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* megatest now checks refc too (#21341)ringabout2023-02-092-1/+6
| | | | | * megatest now checks refc too * fixes refc
* fix #20253 (#21174)Bung2023-01-131-0/+10
| | | | | | | | | * fix #20253 * change NimbleStableCommit * Update koch.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fix #14667 (#21190)Bung2022-12-281-0/+12
|
* add test case for #20289 (#21180)Bung2022-12-271-0/+15
|
* fix #11634 (#21146)Bung2022-12-231-0/+20
|
* Don't repeat suggestions for same symbol (#21140)Jake Leahy2022-12-223-27/+48
| | | | | | | | | | * Track seen module graphs so symbols from the same module aren't repeated Add test case * Track symbols instead of modules * Don't show duplicate symbols in spell checker Removes the declared location from the message. Since we don't show duplicates anymore it would be a bit misleading if we only show the location for the first declaration of the symbol
* fix #16541 (#21148)Bung2022-12-221-0/+12
|
* fixes #19292; fixes #21122; fixes putEnv and setEnv with vcc (#21143)ringabout2022-12-201-0/+6
| | | | | * fixes #19292; fixes 21122; fixes putEnv and setEnv with vcc * add a test
* fix #21109 (#21127)Bung2022-12-191-0/+13
|
* generic `define` pragma + string alias (#20979)metagn2022-12-131-16/+48
| | | | | | | | | * generic `define` pragma + string alias * clean * add tests and document * remove char/float, minimize changelog
* fix #15836 proc arg return type auto unexpectly match proc with concr… ↵Bung2022-12-122-0/+23
| | | | | | | | | (#21065) * fix #15836 proc arg return type auto unexpectly match proc with concrete type * fix #16244 * add test case for #12869
* deprecate `do:` meaning `do ():` + misc cleanup (#20927)metagn2022-12-061-1/+1
| | | | | | | | | | | | | | | | | * test disable do: block lambda lifting * fix last test [skip ci] * deprecate `do:` meaning `do ():` + misc cleanup closes https://github.com/nim-lang/RFCs/issues/486 * oops * fix * no idea what could be causing nimsuggest failure other than this * ensure ci works
* fixes #20914; fixes the alignment of big sets (#20918)ringabout2022-11-261-0/+29
| | | | | * fixes #20914; fixes the align of bug sets * add a test for alignof
* add a testcase for vcc (#20915)ringabout2022-11-251-0/+9
| | | test vcc
* fixes a severe bug of testament (#20832)ringabout2022-11-171-0/+1
| | | | | | | | | | | | | | | | | | | * test azure * use exit 1 * try again * use useSysAssert * disable i386 * use refc for tlsEmulation on i386 * use refc * disable i386 Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes a CI error (#20834)ringabout2022-11-141-1/+1
|
* Fix #18079 Illegal storage access compiling call with nested ref/deref (#20738)Bung2022-11-041-0/+11
| | | | | | * add test case * refactoring transformAddrDeref and fix #18079 * fix jsgen
* fix #20272 range of uint64 shows signed upper bound (#20702)Bung2022-11-011-0/+4
|
* fix #16264 low(Time) OverflowDefect (#20552)Bung2022-10-291-0/+2
| | | fix #16264 regression(0.18.0 => devel): import times; echo low(Time) gives OverflowDefect
* fixes nim check with orc (#20456)ringabout2022-10-022-0/+15
| | | | | | | | | | | * fixes nim check with orc * fixes tests * add tests * fixes tests * Update tests/arc/t20456.nim
* remove hack for deprecated csize in compiler (#20463)metagn2022-10-011-5/+1
| | | | | * remove hack for deprecated csize in compiler * remove test
* moderate system cleanup & refactor (#20355)metagn2022-09-283-43/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * system refactor, move out 600 lines * compilation, slice, backwardsindex, misc_num moved out of system * some procs/types moved into arithmetics, basic_types * system no longer depends on syncio * some procs moved around to fit with their surroundings * make exceptions an import, old ops to misc_num * move instantiationInfo back * move back nim version, fix windows echo * include compilation * better docs for imported modules, fix unsigned ops also remove ze, ze64, toU8, toU16, toU32 with nimPreviewSlimSystem * fix terminal * workaround IC test & weird csize bug, changelog * move NimMajor etc back to compilation, rebase for CI * try ic fix * form single `indices`, slim out TaintedString, try fix IC * fix CI, update changelog, addQuitProc * fix CI * try fix CI * actually fix CI finally hopefully * Update lib/system/compilation.nim Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * update kochdocs * hopefully fix csize uses for slimsystem * fix tquit Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* close #15955; add a test case (#20414)ringabout2022-09-243-0/+37
|
* defaults to ORC (#19972)ringabout2022-09-234-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * defaults to Orc * bootstrap using refc * use gc * init orc defines * unregister orc * fix gc * fix commands * add prepareMutation for orc * enable deepcopy for orc * prepareMutation * more fixes * some cases * bug #20081 * partial fixes * partial fixes * fixes command line * more fixes * build Nim with refc * use gc * more fixes * rstore * orc doesn't support threadpool * more shallowCopy * more fixes * fixes unsafeNew * workarounds * small * more fixes * fixes some megatest * tcodegenbugs1 refc * fxies megatest * build nimble with refc * workaround tensordsl tests * replace shallowCopy with move * fixes action * workaround * add todo * fixes important packages * unpublic unregisterArcOrc * fixes cpp * enable windows Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | * remove deprecated pragma syntax from 0.20.0 closes #4651, closes #16653 with a cheap fix for now due to how early `tfFinal` is set * remove type pragma between name and generics * undo removal, try removing bind expression (0.8.14) * fix test, unremove bind expr * remove again * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * dependencies @ HEAD & weave test dependencies * try fix package ci Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Revert "fix #19600 No error checking on fclose (#19836)" (#20297)ringabout2022-09-021-10/+0
| | | This reverts commit 04e4a5ec0e35fc7e1c346c2d002e8487b4b48cb5.
* fixes the regressions caused by the fix for #20107 [backport] (#20287)Andreas Rumpf2022-08-311-0/+1
| | | | * fixes the regressions caused by the fix for #20107 [backport]
* fix #19600 No error checking on fclose (#19836)Bung2022-08-291-0/+9
| | | | | * fix #19600 No error checking on fclose * add IOError to open
* remove some deprecated pre-1.0 stdlib modules (#20202)metagn2022-08-231-48/+0
| | | | | | | | | | | | | | | * remove pre-1.0 stdlib deprecations notable exceptions: * ze, toU8 etc in system/arithmetics * potentially callsite * undo macros, ospaths, securehash, oswalkdir * add sets back * add back future, document deprecated versions * add to changelog [skip ci]
* remove {.this.} pragma, deprecated since 0.19 (#20201)metagn2022-08-232-35/+88
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #20162; locals doesn't work with ORC [backport] (#20163)ringabout2022-08-231-0/+1
| | | fixes #20162; locals doesn't work with ORC