Commit Graph

7477 Commits

Author SHA1 Message Date
Bung
1585bfec3b fix #16758 Nim crashes in fixAbstractType (#20855)
* fix #16758 Nim crashes in fixAbstractType

* Update compiler/semexprs.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-12-11 06:58:29 +01:00
ringabout
07be1791ba fix #21045; getTime with vmopsDanger is broken; alternative to #21054 (#21056)
* fix #21045 getTime with vmopsDanger is broken; alternative to #21054

* typo
2022-12-10 18:57:19 +01:00
Andreas Rumpf
2ebd71bfd4 tiny refactoring related to sink parameter inference logic (#21064)
* tiny refactoring related to sink parameter inference logic

* Update compiler/sempass2.nim
2022-12-10 15:42:22 +01:00
ringabout
db56fc3bcb Revert "fix #15836 proc arg return type auto unexpectly match proc with concr…" (#21057)
Revert "fix #15836 proc arg return type auto unexpectly match proc with concr… (#21044)"

This reverts commit 0cd9bdcf9f.
2022-12-09 21:38:55 +01:00
Bung
0cd9bdcf9f fix #15836 proc arg return type auto unexpectly match proc with concr… (#21044)
fix #15836 proc arg return type auto unexpectly match proc with concrete type
2022-12-09 18:01:13 +01:00
ringabout
ef190f349d remove duplicate assignment (#21050)
`newNodeIT` has already assigned `n.typ` to x.
2022-12-09 08:50:35 +08:00
Vindaar
0a1d4ba842 fix issue #20922 by handling missing expr in exprList for tkOf (#20930)
* fix issue #20922 by handling missing expr in `exprList` for `tkOf`

* fix line numbers in test case

* rewrite exprList requiring expr, add optionalExprList for except

As suggested by @metagn.

* update test case to reflect new code

* update grammar.txt

* update line numbers in test case taking into account nimout

Given the number of errors that are produced it seems easier to do it
this way instead of using `tt.Error`.
2022-12-08 10:59:13 +01:00
ringabout
c5eb3fd4f0 fixes #9839; fixes noReturn pragma doesn't work for non-simple templates (#21048) 2022-12-08 10:37:02 +01:00
metagn
4ca2dcb404 Named arguments in commands + many grammar fixes (#20994)
* Breaking parser changes, implement https://github.com/nim-lang/RFCs/issues/442

Types are separated from expressions and better reflected in the grammar.

* add test

* more accurate grammar

* fix keyword typedescs

* accept expressions in proc argument lists

* CI "fixes"

* fixes

* allow full ref expressions again, adapt old tests

* cleanup, fix some tests

* improve grammar, try and revert semtypes change

* restrict sigil binding to identOrLiteral

* fix, should have caught this immediately

* add changelog entry, fix double not nil bug

* correct grammar

* change section

* fix

* real fix hopefully

* fix test

* support LL(1) for tuples

* make grammar.txt too
2022-12-06 13:11:56 +01:00
ringabout
1564ae650f fixes #21027; cast expressions need a type (#21029)
* fixes #21027; cast expressions need a type

* Apply suggestions from code review

Thanks to @beef331
2022-12-06 13:09:50 +01:00
ringabout
b2c7019006 definite assignment analysis for let (#21024)
* draft for let daa

* patch

* fixes bugs

* errors for global let variable reassignments

* checkpoint

* out param accepts let

* add more tests

* add documentation

* merge tests
2022-12-06 10:19:12 +01:00
metagn
6d8cf25bd7 deprecate do: meaning do (): + misc cleanup (#20927)
* 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
2022-12-06 09:44:26 +01:00
metagn
739e1badb6 stdlib organization & documentation improvements (#20971)
* stdlib organization & documentation improvements

* fix CI

* Update doc/lib.md

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

* fix ci, remove jshttpcore, export in jsfetch instead

* fix alphabetical order violations

* add cmdline, db_odbc

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
2022-12-06 09:37:03 +01:00
Bung
5d469686b0 fix #20829 Regression in int64 type matching since (#21019)
fix #20829 Regression in int64 type matching
2022-12-06 07:44:54 +01:00
ringabout
feb0481ba3 Revert "fixes #20883; Unspecified generic on default value segfaults the compiler" (#21028)
Revert "fixes #20883; Unspecified generic on default value segfaults the compiler (#20917)"

This reverts commit 10b6e4f5b4.
2022-12-06 12:50:16 +08:00
metagn
e98efdcc5e fix #16639 (#21017) 2022-12-05 22:52:49 +01:00
Yuriy Glukhov
c47d5196be Dont produce initing moves for sfNoInit variables in closure env (#21026) 2022-12-05 22:49:31 +01:00
ringabout
b83bd282dc fixes #20954; bounchecks for len(toOpenArray()) [backport] (#20956)
* bounchecks for len(toOpenArray())

* add a testcase
2022-12-05 22:27:18 +01:00
ringabout
a8090f7d65 fixes isLocalVarSym; an implicit global is a global nonetheless (#21025)
fixes isLocalVarSym; an implicit global is a global nonetheless
2022-12-05 22:24:36 +01:00
ringabout
6f96c4bc96 ref #20846; give a deprecation message for overriding = hook (#21020)
give a deprecation message for overriding `=` hook
2022-12-05 07:13:51 +01:00
metagn
5536f74992 fix #20996 (#21016)
* fix #20996

* hopefully fix
2022-12-04 20:37:23 +01:00
ringabout
55373e65b4 unpublic arrayWith and rename it to nimArrayWith (#21006)
* unpublic arrayWith

* unindent
2022-12-04 15:39:14 +08:00
ringabout
10b6e4f5b4 fixes #20883; Unspecified generic on default value segfaults the compiler (#20917)
test CI
2022-12-01 22:04:11 +01:00
Ikko Ashimine
a104aa4714 IC: fix typo in rodfiles.nim (#20989)
preceeded -> preceded
2022-12-01 14:26:59 -05:00
Bung
658b28dc57 tyInt tyUint fit target int bit width (#20829) 2022-12-01 13:34:00 +01:00
ringabout
a70d3abd37 replace data init function with consts for typeinfov2 (#20977)
* replace data initial function with consts for typeinfov2

* fixes

* fixes

* workaround C++

* C++ keeps the previous implementaion

* fixes
2022-12-01 13:29:58 +01:00
metagn
2449c37137 better procvar ambiguity errors, clean up after #20457 (#20932)
* better procvar ambiguity errors, clean up after #20457

fixes #6359, fixes #13849

* only trigger on closedsymchoice again

* new approach

* add manual entry for ambiguous enums too

* add indent [skip ci]

* move to proc
2022-12-01 08:01:13 +01:00
ringabout
a7133e0594 removed unused sections in codegen (#20976) 2022-11-30 21:51:13 +01:00
Jaremy Creechley
5658e8e5c5 Add --genCDeps for better integration with CMake (#20950)
* add gencdeps option

* add case statement

* Update compiler/main.nim

* Update compiler/main.nim

* Apply suggestions from code review

Fixes

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-11-29 15:27:48 +01:00
ringabout
3d5edb41be fixes #20958; fixes the return type of slice function [backport] (#20959)
* fixes #20958; fixes the return type of slice function

* add a testcase
2022-11-29 07:21:44 +01:00
ringabout
d4afa53fd5 fixes #13583; enforce void for nkWhileStmt (#20947)
* fixes #13583; enfore void for nkWhileStmt

* one more case
2022-11-29 06:41:38 +01:00
metagn
15d00ca0e1 allow proc expressions in place of statements (#20935)
properly fixes #18714
2022-11-29 06:37:00 +01:00
metagn
555c5ed1a7 fix bugs with dot & call operators [backport] (#20931)
* 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
2022-11-28 21:33:02 +01:00
Jake Leahy
d26b1232ee Add nkFastAsgn into semExpr (#20939)
* Add nkFastAsgn into case statement

* Add test case
2022-11-27 20:09:25 +01:00
ringabout
b57a9637e8 fixes #20914; fixes the alignment of big sets (#20918)
* fixes #20914; fixes the align of bug sets

* add a test for alignof
2022-11-26 07:48:11 +01:00
ringabout
27a38a9fce fix #13790; ptr char (+friends) should not implicitly convert to cstring (#20761)
* fix =#13790 ptr char (+friends) should not implicitly convert to cstring

* Apply suggestions from code review

* first round; compiles on windows

* nimPreviewSlimSystem

* conversion is unsafe, cast needed

* fixes more tests

* fixes asyncnet

* another try another error

* last one

* true

* one more

* why bugs didn't show at once

* add `nimPreviewCstringConversion` switch

* typo

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
2022-11-24 07:49:23 +01:00
ringabout
ef29987781 An unnamed break in a block now gives an UnnamedBreak warning (#20901)
* unnamed break in the block now gives an error

* bootstrap

* fixes

* more fixes

* break with label

* label again

* one moee

* Delete test5.txt

* it now gives a UnnamedBreak warning

* change the URL of bump back to the original one
2022-11-24 07:31:47 +01:00
metagn
5adfaa2a92 render post expr blocks better (#20871)
* render post expr blocks

* remove pointless diff

* fix PR split mistake
2022-11-22 20:40:05 +01:00
Bung
8cfce70738 fix #18964 Small string case with else statement first in AST evaluat… (#20862)
fix #18964 Small string case with else statement first in AST evaluates wrongly
2022-11-22 20:08:17 +01:00
ringabout
0448f30fd9 fixes #20026; marks system procs which can raise defects (#20864)
* marks system procs which can raise defects

* add tests

* add more systemRaisesDefect

* add comment
2022-11-22 20:07:00 +01:00
Bung
354eb2a86c fix #20866 [ORC] Bad codegen for global pointer to iterator (#20876) 2022-11-22 20:05:16 +01:00
Yuriy Glukhov
fc37554795 NimMain/NimPreMain calls are now only volatile when it makes sense. (#20882) 2022-11-22 15:55:31 +01:00
Kyle Coffey
f4553af343 Fix compiler build with -d:nimDebugReorder (#20888)
* add missing import for -d:debugReorder

* rename compile-time symbol to match best practices

Fix #20887.
2022-11-22 15:51:17 +01:00
Matt Moseley
75493cfb78 Small cleanup to cgen output (#20874) 2022-11-21 15:00:46 -05:00
ringabout
1707bc4a99 fixes #20856; store defaults directly (#20859)
* fixes #20856; store defaults directly

* fixes

* fixes

* check

* fixes
2022-11-17 09:38:50 +08:00
ringabout
06cd15663d fixes ptr to cstring warnings[backport] (#20848)
* fix =#13790 ptr char (+friends) should not implicitly convert to cstring

* Apply suggestions from code review

* first round; compiles on windows

* nimPreviewSlimSystem

* conversion is unsafe, cast needed

* fixes more tests

* fixes asyncnet

* another try another error

* last one

* true

* one more

* why bugs didn't show at once

* add `nimPreviewCstringConversion` switch

* typo

* fixes ptr to cstring warnings[backport]

* add fixes

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
2022-11-16 10:22:51 +01:00
ringabout
3d692d08f7 fixes a long-standing ARC bug (#20849)
* fixes an ARC bug

* add a testcase
2022-11-16 07:36:14 +01:00
Don-Duong Quach
32b145460f createDir is now callable at compile time (#20824) 2022-11-14 20:13:04 +01:00
ringabout
7f2ff909d9 fixes object default fields bugs and add tests (#20839)
* fixes object default fields bugs and add tests

* Update compiler/semmagic.nim

* Update compiler/sem.nim

* Update compiler/sem.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-11-15 00:31:06 +08:00
ringabout
d901d3b8c5 fixes #20836; fixes #20833; fixes unsafeNew (#20841)
* fixes #20836; fixes `unsafeNew`

* fixes #20833
2022-11-14 15:59:37 +01:00