summary refs log tree commit diff stats
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
...
* fix #20891 Illegal capture error of env its self (#22414)Bung2023-08-092-3/+13
| | | | | * fix #20891 Illegal capture error of env its self * fix innerClosure too earlier, make condition shorter
* make the name of procs consistent with the name forwards (#22424)ringabout2023-08-091-1/+1
| | | | | | | | | | | It seems that `--stylecheck:error` acts up when the name forwards is involved. ```nim proc thisOne*(x: var int) proc thisone(x: var int) = x = 1 ``` It cannot understand this at all.
* refactors initSrcGen and initTokRender into returning objects (#22421)ringabout2023-08-092-61/+36
|
* modernize jsgen; clean up some leftovers (#22423)ringabout2023-08-091-16/+13
|
* block ambiguous type conversion dotcalls in generics (#22375)metagn2023-08-091-0/+11
| | | fixes #22373
* modernize lineinfos; it seems that array access hinders strict def analysis ↵ringabout2023-08-091-7/+7
| | | | | | | | | | | | | | | | | | like field access (#22420) modernize lineinfos; array access hinders strict def analysis like field access A bug ? ```nim proc computeNotesVerbosity(): array[0..3, TNoteKinds] = result[3] = {low(TNoteKind)..high(TNoteKind)} - {warnObservableStores, warnResultUsed, warnAnyEnumConv, warnBareExcept} result[2] = result[3] - {hintStackTrace, hintExtendedContext, hintDeclaredLoc, hintProcessingStmt} result[1] = result[2] - {warnProveField, warnProveIndex, warnGcUnsafe, hintPath, hintDependency, hintCodeBegin, hintCodeEnd, hintSource, hintGlobalVar, hintGCStats, hintMsgOrigin, hintPerformance} result[0] = result[1] - {hintSuccessX, hintSuccess, hintConf, hintProcessing, hintPattern, hintExecuting, hintLinking, hintCC} ```
* modernize compiler/reorder, which exposes yet another strictdefs bug (#22415)ringabout2023-08-081-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ```nim {.experimental: "strictdefs".} type NodeKind = enum nkImportStmt nkStmtList nkNone PNode = ref object kind: NodeKind proc hasImportStmt(n: PNode): bool = # Checks if the node is an import statement or # i it contains one case n.kind of nkImportStmt: return true of nkStmtList: if false: return true else: result = false var n = PNode() echo hasImportStmt(n) ``` It compiles without warnings, but shouldn't. As a contrast, ```nim {.experimental: "strictdefs".} type NodeKind = enum nkImportStmt nkStmtList nkNone PNode = ref object kind: NodeKind proc hasImportStmt(n: PNode): bool = # Checks if the node is an import statement or # i it contains one case n.kind of nkImportStmt: result = true of nkStmtList: if false: return true else: result = false var n = PNode() echo hasImportStmt(n) ``` This gives a proper warning.
* clean up `gc:arc` or `gc:orc` in docs and in error messages (#22408)ringabout2023-08-081-1/+1
| | | | | * clean up gc:arc/orc in docs * in error messages
* fixes LineTooLong hints on old compilers (#22412)ringabout2023-08-082-0/+2
| | | | | * fixes LineTooLong hints on old compilers * fixes config/nim.cfg
* modernize compiler/filter_tmpl.nim (#22407)ringabout2023-08-081-11/+9
|
* fix #18823 Passing Natural to bitops.BitsRange[T] parameter in generi… ↵Bung2023-08-083-10/+17
| | | | | (#20683) * fix #18823 Passing Natural to bitops.BitsRange[T] parameter in generic proc is compile error
* fix #22287 nimlf_ undefined error (#22382)Bung2023-08-081-0/+1
|
* use out parameters for getTemp (#22399)ringabout2023-08-076-43/+39
|
* [C++] Member pragma RFC (https://github.com/nim-lang/RFCs/issues/530) (#22272)Juan M Gómez2023-08-076-23/+32
| | | | | | | | | | * [C++] Member pragma RFC #530 rebase devel * changes the test so `echo` is not used before Nim is init * rebase devel * fixes Error: use explicit initialization of X for clarity [Uninit]
* a bit modern code for depends (#22400)ringabout2023-08-071-6/+1
| | | | | * a bit modern code for depends * simplify
* use strictdefs for compiler (#22365)ringabout2023-08-06107-491/+1209
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* Fix some jsgen bugs (#22330)konsumlamm2023-08-062-12/+45
| | | | | Fix `succ`, `pred` Fix `genRangeChck` for unsigned ints Fix typo in `dec`
* Let inferGenericTypes continue if a param is already bound (#22384)SirOlaf2023-08-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Play with typeRel * Temp solution: Fixup call's param types * Test result type with two generic params * Asserts * Tiny cleanup * Skip sink * Ignore proc * Use changeType * Remove conversion * Remove last bits of conversion * Flag --------- Co-authored-by: SirOlaf <>
* fix set op related to {sfGlobal, sfPure} (#22393)Bung2023-08-062-2/+2
|
* fix #15005; [ARC] Global variable declared in a block is destroyed too… ↵Bung2023-08-061-1/+2
| | | | | (#22388) * fix #15005 [ARC] Global variable declared in a block is destroyed too early
* fix server caching issue causing Theme failures (#22378)Daniel Belmes2023-08-061-2/+2
| | | | | | | | | * fix server caching issue causing Theme failures * Fix tester to ignore version cache param * fix case of people using -d:nimTestsNimdocFixup * rsttester needed the same fix
* compiler/llstream: modern code for llstream (#22385)Andreas Rumpf2023-08-041-17/+6
|
* fix #20883 Unspecified generic on default value segfaults the compiler (#21172)Bung2023-08-042-0/+8
| | | | | | | | | * fix #20883 Unspecified generic on default value segfaults the compiler * fallback to isGeneric * change to closer error * Update t20883.nim
* Fix crash when using uninstantiated generic (#22379)Jake Leahy2023-08-041-0/+2
| | | | | | | * Add test case * Add in a bounds check when accessing generic types Removes idnex out of bounds exception when comparing a generic that isn't fully instantiated
* Allow `libffi` to work via `koch boot` (#22322)awr12023-08-032-2/+2
| | | | | | | | | | | | | | | | | | | * Divert libffi from nimble path, impl into koch * Typo in koch * Update options.nim comment * Fix CI Test * Update changelog * Clarify libffi nimble comment * Future pending changelog --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Add experimental inferGenericTypes switch (#22317)SirOlaf2023-08-034-11/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Infer generic bindings * Simple test * Add t * Allow it to work for templates too * Fix some builds by putting bindings in a template * Fix builtins * Slightly more exotic seq test * Test value-based generics using array * Pass expectedType into buildBindings * Put buildBindings into a proc * Manual entry * Remove leftover ` * Improve language used in the manual * Experimental flag and fix basic constructors * Tiny commend cleanup * Move to experimental manual * Use 'kind' so tuples continue to fail like before * Explicitly disallow tuples * Table test and document tuples * Test type reduction * Disable inferGenericTypes check for CI tests * Remove tuple info in manual * Always reduce types. Testing CI * Fixes * Ignore tyGenericInst * Prevent binding already bound generic params * tyUncheckedArray * Few more types * Update manual and check for flag again * Update tests/generics/treturn_inference.nim * var candidate, remove flag check again for CI * Enable check once more --------- Co-authored-by: SirOlaf <> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Revert "fix #22173 `sink` paramers not moved into closure (refc) (#22… ↵Bung2023-08-031-9/+6
| | | | | | | (#22376) Revert "fix #22173 `sink` paramers not moved into closure (refc) (#22359)" This reverts commit b40da812f7aa590ed16df54a492684c228320549.
* fix #22173 `sink` paramers not moved into closure (refc) (#22359)Bung2023-08-021-6/+9
| | | | | * use genRefAssign when assign to sink string * add test case
* fixes #22362; Compiler crashes with staticBoundsCheck on (#22363)ringabout2023-08-022-0/+6
|
* Revert "fixes #22246; generate `__builtin_unreachable` hints for case ↵ringabout2023-07-312-8/+4
| | | | | | | defaults" (#22351) Revert "fixes #22246; generate `__builtin_unreachable` hints for case defaults (#22350)" This reverts commit b56df5c07f7dc9ac9d718ca47c10b0683a9b916f.
* fixes #22246; generate `__builtin_unreachable` hints for case defaults (#22350)ringabout2023-07-312-4/+8
| | | | | | | | | * fixes #22246; generate `__builtin_unreachable` hints * use elif * indentation * fixes holy enums in sim
* fixes an issue where byref wasnt properly handled when using it in a generic ↵Juan M Gómez2023-07-291-3/+10
| | | | | | | param (#22337) * fixes an issue where byref wasnt properly handled when using it in a generic param * removes unreachable check
* implement `ensureMove` (#22339)ringabout2023-07-299-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * implement `ensureMove` * use an additional flag * improve some logics * progress: fixes discard ensureMove * forbids nested expressions * improve error messages * checkpoint * fixes cursor * ADD MORE TESTS * fixes cursorinference again * tiny cleanup * improve error messages * fixes docs * implement comments add more tests * fixes js
* [JS] Fix bitwise ops & shifts (#22340)konsumlamm2023-07-271-30/+53
| | | | | * [JS] Fix bitwise ops & shifts * Test `int64` & `uint64` only with `jsbigint64`
* [JS] Fix casting to ints (#22327)konsumlamm2023-07-251-19/+7
| | | | | * [JS] Fix casting to ints * Simplify `genCast` by using `asUintN`/`asIntN`
* fixes #22301; fixes #22324; rejects branch initialization with a runtime ↵ringabout2023-07-253-19/+32
| | | | | | | | | | | discriminator with defaults (#22303) * fixes #22301; rejects branch initialization with a runtime discriminator with defaults * undefault nimPreviewRangeDefault * fixes tests * use oldCheckDefault
* Fix grammar top rule (#22325)Khaled Hammouda2023-07-241-1/+1
| | | change stmt to complexOrSimpleStmt in the top grammar rule
* fixes #22321; fixes building DLL with --noMain still produces a DllMain (#22323)ringabout2023-07-242-2/+1
| | | | | * fixes #22321; Building DLL with --noMain produces an unexpected DllMain on devel branch * remove implicit nomain
* Expands codegenDecl to work in function params. fixes #22306 (#22307)Juan M Gómez2023-07-236-18/+30
| | | | | | | * Expands codegenDecl to work in function params. fixes #22306 * makes the test more concrete so T{lit} params dont match * adds sfCodegenDecl
* implemented 'push quirky' switch for fine grained control over the ex… ↵Andreas Rumpf2023-07-237-20/+25
| | | | | | | (#22318) * implemented 'push quirky' switch for fine grained control over the exception handling overhead * documentation
* Check try block for endsInNoReturn (#22314)SirOlaf2023-07-221-2/+3
| | | Co-authored-by: SirOlaf <>
* Fix doc comment rendering for concepts (#22312)konsumlamm2023-07-221-1/+1
|
* Open scope for defer (#22315)SirOlaf2023-07-221-0/+2
| | | Co-authored-by: SirOlaf <>
* fixes #22297; return in the finally in the closure iterators (#22300)ringabout2023-07-221-1/+3
| | | ref #22297; return in the finally in the closure iterators
* `infixArgument` fail in `renderer.nim` sometimes (#22264)Ryan McConnell2023-07-201-1/+5
| | | | | * fixing minor typo * Adding err msg
* fix `jsondoc` not getting `showNonExports` flag (#22267)Jake Leahy2023-07-202-8/+11
| | | Pass the config down so we can check if the `--showNonExports` flag is used
* minor code improvement (#22293)Andreas Rumpf2023-07-191-6/+7
|
* fixes #22268; fixes `move` codegen (#22288)ringabout2023-07-193-14/+12
|
* fixes #6499; disallow built-in procs used as procvars (#22291)ringabout2023-07-191-0/+1
|
* Fix #22281 (#22289)Anna2023-07-181-1/+1
| | | Respect `--gcc.exe` and similar options when `--genScript:on` is used.