diff options
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug_report.md | 26 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/feature_request.md | 3 | ||||
-rw-r--r-- | changelogs/changelog_1_0_2.md | 56 | ||||
-rw-r--r-- | compiler/ast.nim | 2 | ||||
-rw-r--r-- | compiler/condsyms.nim | 2 | ||||
-rw-r--r-- | compiler/jsgen.nim | 2 | ||||
-rw-r--r-- | compiler/semexprs.nim | 2 | ||||
-rw-r--r-- | doc/manual.rst | 19 | ||||
-rw-r--r-- | lib/pure/math.nim | 2 | ||||
-rw-r--r-- | lib/std/monotimes.nim | 3 | ||||
-rw-r--r-- | testament/important_packages.nim | 6 | ||||
-rw-r--r-- | tests/dll/nimhcr_integration.nim | 3 | ||||
-rw-r--r-- | tests/js/t12223.nim | 20 | ||||
-rw-r--r-- | tests/misc/t12480.nim | 5 |
14 files changed, 127 insertions, 24 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8a4f43123..895b4ba61 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,45 +1,39 @@ --- name: Bug report about: Have you found an unexpected behavior? Use this template. ---- +title: Think about the title, twice +labels: '' +assignees: '' -<!-- Think about the title, twice. --> +--- -<!-- Summarize the problem here, keep it short and simple. --> Function `echo` outputs the wrong string. - ### Example -<!-- Paste your example in the code-block below. --> ```nim echo "Hello World!" ``` - ### Current Output ``` Hola mundo! ``` - ### Expected Output -<!-- What should be the correct output? --> ``` Hello World! ``` - ### Possible Solution -<!--- Have you found a possible solution? Post it here. --> +* In file xyz there is a call that might be the cause of it. ### Additional Information -<!--- For Example: -* Your Nim version (output of `nim -v`). -* Was it working in the previous Nim releases? -* A link to a related issue or discussion. -* A project reference where (and how) the issue causes problems. ---> + +* It was working in version a.b.c +* Issue #abc is related, but different because of ... +* This issue is blocking my project xyz + ``` $ nim -v Nim Compiler Version 0.1.2 diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 52aa53a67..b9f7caad5 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,6 +1,9 @@ --- name: Feature request about: Do you want to suggest a new feature? Use this template. +title: '' +labels: '' +assignees: '' --- diff --git a/changelogs/changelog_1_0_2.md b/changelogs/changelog_1_0_2.md new file mode 100644 index 000000000..aa01c503f --- /dev/null +++ b/changelogs/changelog_1_0_2.md @@ -0,0 +1,56 @@ +# v1.0.2 - 2019-10-23 + + +## Bugfixes + +* fixes the --verbosity:2 regression +* Fixed "Fail to compile a file twice under Windows (v1.0 bug)." [#12242](https://github.com/nim-lang/Nim/issues/12242) +* fix nimpretty removing space before pragma +* JS: gensym is stricter for 'this' +* Fixed "VM Assertion Error with newruntime" [#12294](https://github.com/nim-lang/Nim/issues/12294) +* Fixed "Assertion error when running `nim check` on compiler/nim.nim" [#12281](https://github.com/nim-lang/Nim/issues/12281) +* Fixed "Compiler crash with empty array and generic instantiation with int as parameter" [#12264](https://github.com/nim-lang/Nim/issues/12264) +* Fixed "Regression in JS backend codegen "Error: request to generate code for .compileTime proc"" [#12240](https://github.com/nim-lang/Nim/issues/12240) +* Fix how `relativePath` handle case sensitiviy +* Fixed "SIGSEGV in compiler when using generic types and seqs" [#12336](https://github.com/nim-lang/Nim/issues/12336) +* Fixed "[1.0.0] weird interaction between `import os` and casting integer to char on macosx trigger bad codegen" [#12291](https://github.com/nim-lang/Nim/issues/12291) +* VM: no special casing for big endian machines +* Fixed "`internal error: environment misses` with a simple template inside one of Jester macros" [#12323](https://github.com/nim-lang/Nim/issues/12323) +* nimsuggest: fix tcp socket leak +* nimsuggest: fix tcp socket leak for epc backend +* Fixed "`writeFile` and `write(f, str)` skip null bytes on Windows" [#12315](https://github.com/nim-lang/Nim/issues/12315) +* Fixed "Crash in intsets symmetric_difference" [#12366](https://github.com/nim-lang/Nim/issues/12366) +* Fixed "[regression] VM crash when dealing with var param of a proc result" [#12244](https://github.com/nim-lang/Nim/issues/12244) +* fixes a koch regression that made 'koch boot --listcmd' not work anymore +* Fixed "[regression] inconsistent signed int `mod` operator between runtime, compiletime, and semfold" [#12332](https://github.com/nim-lang/Nim/issues/12332) +* Fixed "Boehm disables interior pointer checking" [#12286](https://github.com/nim-lang/Nim/issues/12286) +* Fixes semCustomPragma when nkSym +* Fixed yield in nkCheckedFieldExpr +* Fixed "`randomize()` from `random` not working on JS" [#12418](https://github.com/nim-lang/Nim/issues/12418) +* Fixed "Compiler crash with invalid object variant" [#12379](https://github.com/nim-lang/Nim/issues/12379) +* fix type's case in random.nim +* Fixed "Update docs with a better way to signal unimplemented methods" [#10804](https://github.com/nim-lang/Nim/issues/10804) +* Fixed "Nim language manual, push pragma is not explained well" [#10824](https://github.com/nim-lang/Nim/issues/10824) +* Fixed "[regression] Importing more than one module with same name from different packages produce bad codegen" [#12420](https://github.com/nim-lang/Nim/issues/12420) +* Namespace unittest enums to avoid name conflicts +* Fixed "VM checks unsigned integers for overflow." [#12310](https://github.com/nim-lang/Nim/issues/12310) +* Fixed "line directive is not generated for first line of function definition" [#12426](https://github.com/nim-lang/Nim/issues/12426) + + + +## Documentation improvements + +* threadpool: fix link in docs (#12258) +* Fix spellings (#12277) +* fix #12278, don't expose internal PCRE documentation +* Fixed "Documentation of quitprocs is wrong" [#12279(https://github.com/nim-lang/Nim/issues/12279) +* Fix typo in docs +* Fix reference to parseSpec proc in readme +* [doc/tut1] removed discard discussion in comments +* Documentation improvements around the db interface +* Easier build instructions for windows - just run `build_all.bat`. +* fix a few dead links and a missing sentence in documentation +* Macro docs additions +* Updated the code example in the os module to use better grammar. +* Mention "lambdas" and `=>` in the manual +* Better documentation on Garbage Collector diff --git a/compiler/ast.nim b/compiler/ast.nim index fdf01cb77..27db97f0c 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -882,7 +882,7 @@ type # for range types a nkRange node # for record types a nkRecord node # for enum types a list of symbols - # for tyInt it can be the int literal + # if kind == tyInt: it is an 'int literal(x)' type # for procs and tyGenericBody, it's the # formal param list # for concepts, the concept body diff --git a/compiler/condsyms.nim b/compiler/condsyms.nim index 7707c1c0d..9e2dc2532 100644 --- a/compiler/condsyms.nim +++ b/compiler/condsyms.nim @@ -99,3 +99,5 @@ proc initDefines*(symbols: StringTableRef) = defineSymbol("nimToOpenArrayCString") defineSymbol("nimHasUsed") defineSymbol("nimFixedForwardGeneric") + defineSymbol("nimnomagic64") + defineSymbol("nimNewShiftOps") diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index a19f35722..4f2fef6b8 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -1169,7 +1169,7 @@ proc genArrayAddr(p: PProc, n: PNode, r: var TCompRes) = first = firstOrd(p.config, typ.sons[0]) if optBoundsCheck in p.options: useMagic(p, "chckIndx") - r.res = "chckIndx($1, $2, $3.length+$2-1)-$2" % [b.res, rope(first), tmp] + r.res = "chckIndx($1, $2, ($3 != null ? $3.length : 0)+$2-1)-$2" % [b.res, rope(first), tmp] elif first != 0: r.res = "($1)-$2" % [b.res, rope(first)] else: diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index ed38f66e1..2e9c5e1f5 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1724,7 +1724,7 @@ proc semReturn(c: PContext, n: PNode): PNode = result = n checkSonsLen(n, 1, c.config) if c.p.owner.kind in {skConverter, skMethod, skProc, skFunc, skMacro} or - isClosureIterator(c.p.owner.typ): + (not c.p.owner.typ.isNil and isClosureIterator(c.p.owner.typ)): if n.sons[0].kind != nkEmpty: # transform ``return expr`` to ``result = expr; return`` if c.p.resultSym != nil: diff --git a/doc/manual.rst b/doc/manual.rst index f8f45b9dc..3a4dc77d8 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -5086,6 +5086,25 @@ The problem here is that the compiler already decided that ``something()`` as an iterator is not callable in this context before ``toSeq`` gets its chance to convert it into a sequence. +It is also not possible to use fully qualified identifiers with module +symbol in method call syntax. The order in which the dot operator +binds to symbols prohibits this. + +.. code-block:: nim + :test: "nim c $1" + :status: 1 + + import sequtils + + var myItems = @[1,3,3,7] + let N1 = count(myItems, 3) # OK + let N2 = sequtils.count(myItems, 3) # fully qualified, OK + let N3 = myItems.count(3) # OK + let N4 = myItems.sequtils.count(3) # illegal, `myItems.sequtils` can't be resolved + +This means that when for some reason a procedure needs a +disambiguation through the module name, the call needs to be +written in function call syntax. Macros ====== diff --git a/lib/pure/math.nim b/lib/pure/math.nim index af54bd506..ee78b6c91 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -48,6 +48,8 @@ ## * `mersenne module<mersenne.html>`_ for Mersenne twister random number generator ## * `stats module<stats.html>`_ for statistical analysis ## * `strformat module<strformat.html>`_ for formatting floats for print +## * `system module<system.html>`_ Some very basic and trivial math operators +## are on system directly, to name a few ``shr``, ``shl``, ``xor``, ``clamp``, etc. include "system/inclrtl" diff --git a/lib/std/monotimes.nim b/lib/std/monotimes.nim index d2d9717d7..4c570d2ee 100644 --- a/lib/std/monotimes.nim +++ b/lib/std/monotimes.nim @@ -58,6 +58,7 @@ when defined(macosx): when defined(js): proc getJsTicks: float = + ## Returns ticks in the unit seconds {.emit: """ var isNode = typeof module !== 'undefined' && module.exports @@ -66,7 +67,7 @@ when defined(js): var time = process.hrtime() return time[0] + time[1] / 1000000000; } else { - return window.performance.now() * 1000000; + return window.performance.now() / 1000; } """.} diff --git a/testament/important_packages.nim b/testament/important_packages.nim index 2ecdbd763..64163b1e0 100644 --- a/testament/important_packages.nim +++ b/testament/important_packages.nim @@ -18,7 +18,7 @@ pkg "c2nim", "nim c testsuite/tester.nim" pkg "cascade" pkg "chroma" pkg "chronicles", "nim c -o:chr -r chronicles.nim", true -pkg "chronos" +# pkg "chronos", "", true pkg "cligen", "nim c -o:cligenn -r cligen.nim" pkg "coco", "", true pkg "combparser" @@ -37,8 +37,8 @@ pkg "gnuplot" pkg "hts", "nim c -o:htss -r src/hts.nim" pkg "illwill", "nimble examples" pkg "inim" -# pkg "itertools", "nim doc src/itertools.nim" -# pkg "iterutils" +pkg "itertools", "nim doc src/itertools.nim" +pkg "iterutils" pkg "jstin" pkg "karax", "nim c -r tests/tester.nim" pkg "loopfusion" diff --git a/tests/dll/nimhcr_integration.nim b/tests/dll/nimhcr_integration.nim index 9bae64ef4..64f6bb708 100644 --- a/tests/dll/nimhcr_integration.nim +++ b/tests/dll/nimhcr_integration.nim @@ -1,5 +1,6 @@ discard """ -output: ''' + disabled: "macosx" + output: ''' main: HELLO! main: hasAnyModuleChanged? true main: before diff --git a/tests/js/t12223.nim b/tests/js/t12223.nim new file mode 100644 index 000000000..c0e75fb44 --- /dev/null +++ b/tests/js/t12223.nim @@ -0,0 +1,20 @@ +discard """ + action: "run" + output: ''' +caught +index out of bounds, the container is empty +''' +""" + +proc fun() = + var z: seq[string] + discard z[4] + +proc main()= + try: + fun() + except Exception as e: + echo "caught" + echo getCurrentExceptionMsg() + +main() \ No newline at end of file diff --git a/tests/misc/t12480.nim b/tests/misc/t12480.nim new file mode 100644 index 000000000..992533ef6 --- /dev/null +++ b/tests/misc/t12480.nim @@ -0,0 +1,5 @@ +discard """ + errormsg: "'return' not allowed here" +""" + +return \ No newline at end of file |