summary refs log tree commit diff stats
path: root/tests/concepts
Commit message (Collapse)AuthorAgeFilesLines
* adds another fix for concept in JS (#23535)ringabout2024-04-241-4/+12
| | | ref https://github.com/nim-lang/Nim/issues/9550
* fixes testament targets field (#23472)ringabout2024-04-031-1/+1
|
* fixes #9550; Concept related crash only when compiling to JS (#23470)ringabout2024-04-021-0/+11
| | | fixes #9550
* fixes #22723; skips tyUserTypeClasses in injectdestructors (#23341)ringabout2024-02-241-0/+24
| | | fixes #22723
* 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.
* Changing generic weight of `tyGenericParam` (#22143)Ryan McConnell2024-01-052-50/+57
| | | | | | | | | | | | This is in reference to a [feature request](https://github.com/nim-lang/Nim/issues/22142) that I posted. I'm making this PR to demonstrate the suggested change and expect that this should be scrutinized --------- Co-authored-by: Bung <crc32@qq.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Fix doc comment rendering for concepts (#22312)konsumlamm2023-07-221-1/+1
|
* Fix concepts with doc comments (#22228)Jake Leahy2023-07-061-0/+11
| | | | | | | | | | | | | | | * Add testcase This tries to use a concept with a doc comment which currently leads to a segfault * Ignore nil nodes which happen when there are doc comments in new style concept This was done instead of semming the comments since `semConceptDecl` says it only supports lists of actual statements * Go with alternative fix: Sem comments but ignore them Since `nil` could mean anything it is best to not silently ignore it (In case another nil problem happens in future Also fix test case so it isn't an infinite loop
* close #12852; add a test case (#22016)ringabout2023-06-061-0/+55
|
* fixes #21263; consider all candidates for concept matches (#21265)ringabout2023-01-171-0/+25
|
* fix bugs with dot & call operators [backport] (#20931)metagn2022-11-281-19/+19
| | | | | | | | | | | | | | | | | | | * better error messages for dot operators [backport] fixes #13063 * also fixes #7777 * fix #6981 and #9831 too * fix * minor improvement * sus test fixes * make test multiplatform lol * fix nimsuggest test, extra improvements
* Support doc comments in new-styled concepts (#20752)konsumlamm2022-11-041-0/+3
| | | Support comments in new-styled concepts
* defaults to ORC (#19972)ringabout2022-09-232-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix fixAbstractType for user defined typeclasses, fixes #19730 & #18409 (#19732)nc-x2022-04-302-0/+57
|
* deprecate unsafeAddr; extend addr (#19373)flywind2022-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* style usages part one (openarray => openArray) (#19321)flywind2022-01-041-4/+4
| | | | | * style usages (openArray) * revert doc changes
* Make error message for empty new-styled concept more descriptive (#18506)konsumlamm2021-07-181-3/+2
| | | | | | | * Allow empty new-styled concept Slightly improve error messages * Make empty new-styled concepts an error
* close #17636 (#17643)flywind2021-04-062-48/+45
|
* new-style concepts implementation, WIP (#15251)Andreas Rumpf2021-02-244-3/+109
| | | | | | | | | | | | | * fixes #15210 [backport:1.2] * make tests green * make ordinal work * makes Swapable test compile * make Indexable example work * concepts: 'self' is now 'Self' * concepts: make Dictionary example compile * document the new concept implementation * concepts: make typeDesc work properly * concepts: allow documentation comments (d'oh)
* Add testcase for #16897 (#16917)Clyybber2021-02-021-0/+33
|
* make megatest consistent with unjoined tests wrt newlines, honor newlines in ↵Timothee Cour2020-11-281-1/+1
| | | | | | | output spec (#16151) * fix megatest newlines * still allow missing trailing newline for now but in a more strict way than before
* close #8558(add testcase for #8558) (#15872)flywind2020-11-071-0/+26
|
* add testcase for #8012 (#15785)flywind2020-10-301-0/+15
|
* fix assignment to converted concept type (#15051)jcosborn2020-07-241-17/+37
| | | | | | | * fix assignment to converted concept type * check for resolved concepts * add extra test
* Clean out Deprecated proc (#14797)Juan Carlos2020-06-291-15/+6
| | | | * Remove and/or clean out Deprecated 'add' proc for floats * Update a test
* fix #14217 (#14218)cooldome2020-05-051-2/+2
| | | | | * fix #14217 Co-authored-by: cooldome <ariabushenko@bk.ru>
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-1/+1
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* fixes #12741 (#14005)Andreas Rumpf2020-04-191-39/+45
| | | | * fixes #12741 * updated tests
* fix #13538 sigmatch errors are now sorted (#13701)Timothee Cour2020-03-202-31/+31
| | | | | | | * fix #13538 sigmatch now sorted and has reliable order * re-enable tests that were disabled because of that bug * fix remaining tests and un-disable 2 other tests that were affected by this bug
* fixes a test caseAraq2019-12-241-1/+3
|
* remove deprecated procs (#12535)Andreas Rumpf2019-11-052-12/+12
|
* ungeneric unsigned ops (#12230)Jasper Jenkins2019-10-111-7/+7
| | | | | | | | | | * ungenericise unsigned ops, remove nimNewShiftOps * fix/remove tests * update t6448 * fix line info * disable on 32bit * fix different line info * add changelog entry
* fixes #11807 (#11900)Andreas Rumpf2019-08-071-6/+6
| | | | | * fixes #11807 * make tests green again
* fix #11854 (#11857)Arne Döring2019-07-301-1/+1
|
* address commentsTimothee Cour2019-07-081-2/+2
|
* make tests/concepts/t3330.nim disabled again: the order of candidates is ↵Timothee Cour2019-07-081-5/+5
| | | | machine dependent
* fix testsTimothee Cour2019-07-082-57/+111
|
* make megatest work againAraq2019-04-022-0/+5
|
* 32 bit fixes (#10608)Arne Döring2019-02-131-6/+6
|
* megatest checks output and nimoutArne Döring2018-12-111-1/+3
|
* megatest can be executedArne Döring2018-12-111-0/+0
|
* require errormsg to be specified before file.Arne Döring2018-12-112-17/+15
|
* cleanup tests; don't use non-working 'msg' spec fieldAraq2018-11-234-4/+3
|
* More descriptive names of test files (#9531)Miran2018-10-291-0/+0
| | | | | * change generic `tissues` name to more specific * change `tvarious` to more specific names
* make tests green againAndreas Rumpf2018-10-241-0/+1
|
* Merge tests into a larger file (part 5 of ∞) (#9368)Miran2018-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* correctly render AST in doAssert/assert condition: fixes #8518; refs #9301 ↵Timothee Cour2018-10-141-37/+52
| | | | | | (#9332) * fixes #8518; refs #9301; correctly render AST in doAssert condition
* put several issues in tests (#9352)Miran2018-10-131-11/+57
| | | | | | * put several issues in tests * remove wrong test
* Merge tests into a larger file (part 1 of ∞) (#9318)Miran2018-10-1216-428/+862
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * merge actiontable tests * merge arithm tests * merge array tests * merge assign tests * merge bind tests * merge casestmt tests * merge closure tests * merge cnt seq tests * merge collections tests * merge concept issues tests * merge concept tests * fix failing tests * smaller outputs Use `doAssert` where possible. * fix wrong output * split `tcomputedgoto` * revert merging concepts * fix failing test
* compiler: show name of instantiating context in error traces (#6763) (#9207)xzfc2018-10-111-2/+2
|