Jason Beetham
ee2eb5cae2
Fix subranges of distinct types ( #18816 ) [backport]
2021-09-07 17:11:08 +02:00
Jason Beetham
30d28bcefc
Fixes implicit and explicit generics in procedures ( #18808 )
...
* Fixes implicit and explicit generics
* moved block logic into 'maybeInstantiateGeneric'
* Added more tests
* Update compiler/semexprs.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de >
2021-09-06 20:11:21 +02:00
Andreas Rumpf
34a53e8049
fixes #12642 ( #18811 )
...
* fixes #12642
* update important packages; refs #18804
* fixes #18805 ; refs #18806
* fixes a regression
* Update testament/categories.nim
Co-authored-by: flywind <xzsflywind@gmail.com >
* progress
* progress
Co-authored-by: flywind <xzsflywind@gmail.com >
2021-09-06 17:43:03 +02:00
Jason Beetham
90bfd34250
'[]' can now be used for iterators ( #18814 )
2021-09-06 15:30:49 +02:00
Andreas Rumpf
73841ae194
fixes #14165 , fixes #18739 , fix the second example of #6269 ( #18812 )
2021-09-06 13:12:14 +02:00
Jason Beetham
7ae52d7791
Fix recursive generic typed defs ( #18809 )
2021-09-06 09:43:26 +02:00
Andreas Rumpf
2e2d928846
formal grammar updates [backport:1.2] ( #18803 )
2021-09-04 19:52:57 +02:00
Andreas Rumpf
5c85e480a6
unicode operator bugfixes ( #18802 )
2021-09-04 17:49:27 +02:00
Andreas Rumpf
e8dad482a3
fixes #16246 ( #18800 )
2021-09-04 15:57:16 +02:00
Sven Keller
3c2edd142b
fix for js strict mode ( #18799 )
...
* Assignments, which would accidentally create global
variables, instead throw an error in strict mode
* Assignment to a getter-only property
Co-authored-by: Sven Keller <s.keller@cortona.de >
2021-09-04 12:53:02 +02:00
Andreas Rumpf
ac7acd827c
we need something better than warningAsError for effect handling viol… ( #18796 )
...
* we need something better than warningAsError for effect handling violations
2021-09-04 08:18:00 +02:00
Andreas Rumpf
cddf8ec6f6
implements https://github.com/nim-lang/RFCs/issues/407 ( #18793 )
2021-09-03 21:52:24 +02:00
Andreas Rumpf
c2b20516d3
implemented Unicode operators ( #18789 )
...
* implemented Unicode operators; refs https://github.com/nim-lang/RFCs/issues/388
* bugfix
* better test
* arguably more elegant implementation
* Update changelog.md
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com >
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com >
2021-09-03 17:31:16 +02:00
flywind
905fae51f6
remove unnecessary if statement ( #18792 )
2021-09-03 16:41:00 +02:00
Andreas Rumpf
06ff0e9624
fixes #18769 ( #18790 )
2021-09-03 15:18:55 +02:00
Andreas Rumpf
0887dcc398
fixes #18786 ( #18788 )
2021-09-03 09:03:26 +02:00
Andreas Rumpf
a7cae2bda2
fixes #16325 [backport:1.4] ( #18784 )
2021-09-02 17:15:11 +02:00
Andreas Rumpf
e0ef859130
strict effects ( #18777 )
...
* fixes #17369
* megatest is green for --cpu:arm64
* docgen output includes more tags/raises
* implemented 'effectsOf'
* algorithm.nim: uses new effectsOf annotation
* closes #18376
* closes #17475
* closes #13905
* allow effectsOf: [a, b]
* added a test case
* parameters that are not ours cannot be declared as .effectsOf
* documentation
* manual: added the 'sort' example
* bootstrap with the new better options
2021-09-02 12:10:14 +02:00
flywind
72fa5833ad
fix #9778 (pairs iterator calling a helper proc with tuple return type will cut the iterator yield into half) ( #18767 )
...
* test someSymFromImportTable
* Update compiler/lookups.nim
* test nkTupleConstr
* use isConstExpr
* add tests
* add comments and todo
* use todo
2021-09-02 07:41:14 +02:00
flywind
8f4bdb3596
[minor]break loops after a candidate is added to seqs ( #18770 )
...
* [minor]break loops when added
* Update compiler/lookups.nim
Co-authored-by: Clyybber <darkmine956@gmail.com >
Co-authored-by: Clyybber <darkmine956@gmail.com >
2021-08-31 13:32:37 +02:00
Timothee Cour
fa7c1aa864
move PNode.comment to a side channel, reducing memory usage during compilation by a factor 1.25x ( #18760 )
...
* move PNode.comment so a side channel, reducing memory usage
* fix a bug
* fixup
* use sfHasComment to speedup comment lookups
* fix for IC
* Update compiler/parser.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de >
2021-08-29 15:54:07 +02:00
Timothee Cour
014edde36a
followup #18759 : make compiler build cleanly with 0 warnings/hints ( #18764 )
2021-08-28 16:34:27 -07:00
Miran
719718df2f
more minor bootstrapping cleanups ( #18759 )
2021-08-28 08:27:56 +02:00
flywind
5eba372570
[minor] break loops if it is ambiguous ( #18745 )
...
* [minor] break loops if it is ambiguous
* Update compiler/lookups.nim
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com >
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com >
2021-08-27 11:50:06 +02:00
Timothee Cour
3aa16c1de0
fix RFC #341 : dot-like operators are now parsed with same precedence as . ( #18711 )
...
* fix RFC #341 : dot-like operators are now parsed with same precedence as `.`
* fixup
* [skip ci] address comment in changelog
* address comment
* update grammmar
* add manual entry
* fixup
* -d:nimPreviewDotLikeOps
* address comment to unblock PR: move nimPreviewDotLikeOps out of config/config.nims
2021-08-25 06:50:40 +02:00
flywind
3d1bba04ab
[minor]use addInt and addFloat ( #18733 )
...
* unify int and uint
* back
* minor
2021-08-24 17:16:12 +02:00
Miran
24178bf8aa
get rid of the warnings during bootstrapping ( #18741 )
...
* fix bootstrapping hints and warnings
* revert removals in ccgtypes
2021-08-24 17:15:26 +02:00
flywind
8a8267e2bc
fix a typo ( #18736 )
2021-08-23 21:05:22 +08:00
flywind
061a9183f7
replace wrt with proper word ( #18724 )
...
* what does wrt mean?
* clarify
2021-08-22 06:21:53 +02:00
Timothee Cour
f2910077ac
sigmatch: support optional params with last block arg(s) ( #18631 )
...
* sigmatch: support optional params with last block arg
* add tests
* works with multiple block args
* cleanup
* address comment
2021-08-20 10:13:03 +02:00
flywind
13b9729183
fix #18627(Program segfaults with ARC when using openArray[string]) ( #18713 )
...
* fix #18627
* add testcase
* rename
* another
* remove tyVarargs
2021-08-19 19:56:52 +02:00
flywind
8fa0decf6b
fix a typo ( #18715 )
2021-08-19 21:54:45 +08:00
Timothee Cour
394f4ac7bb
improvements to addInt and $ for integer types ( #18592 )
...
* improvements to $(SomeInteger) and addInt
* remove mIntToStr, mInt64ToStr
* improvements
* fix tests/pragmas/tinjectstmt.nim; the diff is harmless, cgen code is identical with -d:danger or debug mode
* rm tests/system/tstrmantle.nim
* revert compiler/jsgen.nim for -d:nimVersion140
2021-08-19 11:33:52 +02:00
Timothee Cour
7b58dc2de0
allow building 1.4.0 from devel ( #18708 )
...
* allow building 1.4.0 from devel
* changelog
2021-08-18 19:33:11 +02:00
flywind
0778a38bbd
[wip]better hint message for JS ( #18704 )
...
* better hint message for JS
* both
2021-08-18 15:53:52 +02:00
Timothee Cour
1acba63cb7
cross compilation targetting windows now supports nim r: nim r -d:mingw main ( #18682 )
...
* cross compilation targetting windows now supports `nim r`: `nim r -d:mingw main`
* quoteShell
* address comment: remove `conf.getConfigVar("nimrun.exe")`
2021-08-16 09:32:12 +02:00
Timothee Cour
b24812df5f
properly fix #10053 ; FieldDefect msg now shows discriminant value + lineinfo, in all backends (c,vm,js) ( #11955 )
...
* fix #10053 FieldError for vm
* fixup
* FieldError now also shows runtime value of discriminant
* fix field error reporting in vm
* also report culprit line info in err msg
* fix errors for newruntime 2
* fix for js
* fixup
* PRTEMP4
* works
* works
* works perfect
* refactor
* std/private/repr_impl
* suppport --gc:arc
* cleanup
* refactor
* simplify
* simplify
* simplify
* fixup
* move out compiler.vmgen.genCustom
* fixup
* fixup
* add tests
* revert compiler/debugutils.nim
* simplify reprDiscriminant
* fixup
* lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim
* try to fix D20210812T165220
* honor --declaredlocs
* control toFileLineCol via --declaredlocs
2021-08-13 09:35:48 +02:00
Andreas Rumpf
018465a234
fixes #18643 [backport:1.0] ( #18678 )
2021-08-12 08:25:11 +02:00
Timothee Cour
c94933acb7
fix #18674 --nimcache now works better with --os:windows ( #18675 )
2021-08-11 13:30:51 -07:00
Andreas Rumpf
bc14b77359
fixes #18665 DFA generator bug ( #18676 )
2021-08-11 17:19:23 +02:00
Timothee Cour
6c1bd4bb1c
fix: var a{.foo.} = expr inside templates (refs #15920 ) (except when foo is overloaded) ( #13869 )
...
* fix: `var a{.foo.} = expr` inside templates
* add test
* improve tdecls test
* improve tests
* add failing test
* PRTEMP
* fixup
2021-08-11 12:17:17 +02:00
Timothee Cour
8540065754
--cc:env now works correctly to assign linker executable, allowing to cross-compile/run for windows on osx via wine ( #18672 )
...
* --cc:env now works correctly to assign linker executable, allowing using wine on osx
* fixup
2021-08-11 11:42:01 +02:00
Kyle Brown
31fc0f9718
Remove unused imports, and deprecated function usage ( #18663 )
...
* clean up imports and slice to remove delete
* revert buggy code
* Replace "delete" with setlen to remove depreciation warning
2021-08-11 01:26:42 +02:00
Timothee Cour
8ce782d463
Add optional recursive arg to distinctBase (v2) ( #18659 )
...
* Add optional recursive arg to distinctBase
* Add docs and examples
Co-authored-by: ALANVF <alan.invents@gmail.com >
2021-08-09 08:51:39 +02:00
flywind
2bc07554cc
make proc names consistent ( #18626 )
...
* rename `endswith` to `endsWith`
* rename
2021-08-01 12:52:24 +01:00
Andreas Rumpf
562dde624f
fixes #18371 ( #18617 )
2021-07-30 12:05:14 +02:00
Timothee Cour
9a26f5059b
refs #16613 : check opcWrDeref for nil ( #18613 )
2021-07-30 09:30:22 +02:00
Andreas Rumpf
a273ea70e8
implements overloadable enum values; WIP ( #18470 )
...
* implements overloadable enum values
* simpler code
2021-07-28 12:46:28 +02:00
Timothee Cour
8d2f6bba3a
support same-line doc comments in routines ( #18595 )
...
* support same-line comments in routines
* remove assert as per review comment
2021-07-27 19:50:59 +02:00
Andreas Rumpf
c86f9590fb
fixes #18570 ( #18599 )
2021-07-27 12:48:27 +02:00