Commit Graph

6213 Commits

Author SHA1 Message Date
Andreas Rumpf
b6fb609e0d destructors: don't produce stupid code for 'cast' (#14208) [backport:1.2]
* destructors: don't produce stupid code for 'cast'

* fixes #14207
2020-05-04 07:43:22 +02:00
Andreas Rumpf
49b28f1997 fixes #14136 (#14198) 2020-05-03 00:12:52 +02:00
Araq
7f1d2489ad improve the 'has to be discarded' error message 2020-05-02 22:31:19 +02:00
Araq
87ac28d19a fixes #14159 [backport:1.2] 2020-05-02 22:31:19 +02:00
Araq
4301a7bdf0 fixes #14177 2020-05-02 22:31:19 +02:00
Araq
15f54728ef fixes a bug encountered when running 'nim check posix_haiku.nim' 2020-05-02 22:31:19 +02:00
Clyybber
83547ec769 Make unreachable else in case statements a warning instead of an error (#14190)
* Fix #14019 by making trailing else a warning

* Rename to UnreachableElse
2020-05-02 16:09:02 +02:00
Clyybber
1f1e4de3bc Make ./koch temp --gc:arc work (#14186) 2020-05-01 20:25:18 +02:00
Andreas Rumpf
d5fc35c968 arc: do not unload globals when building a library [backport:1.2] (#14180) 2020-05-01 09:15:46 +02:00
Andreas Rumpf
cf3e0008b9 fixes #13986 [backport:1.2] (#14173) 2020-04-30 19:32:03 +02:00
Clyybber
d6e1b5c070 Fix #14160 (#14161)
* Fix #14160

* Add testcase
2020-04-30 02:01:07 +02:00
Araq
bd57f0cd32 fixes another silly arc/orc bug [backport:1.2] 2020-04-29 22:14:01 +02:00
Andreas Rumpf
d9e907c0e2 fixes #14079 [backport:1.2] (#14163) 2020-04-29 21:58:59 +02:00
hlaaftana
707367e1ca many bugfixes for js (#14158)
* many bugfixes for js

fixes #12672, fixes #14153, closes #14123, closes #11331, fixes #11783, fixes #13966, fixes #14087, fixes #14117, closes #12256.

mostly fixes the fact that it was allowed to assign to newly created temp variables. additionally attempts to get rid of null initialized seqs/strings (though they might pop up here and there); this simplifies a lot of things and makes code size smaller. even if null seqs/strings pop up here and there it's still better than all those bugs existing.

* formatting fixes

* CI fixes

* more CI fixes
2020-04-29 20:55:09 +02:00
hlaaftana
800ce5b950 Fix negative indexed arrays for JS, refs #13966 (#14152)
* Fix negative arrays for JS, refs #13966

* small extra fix: no need to .slice() cstring in JS
2020-04-29 08:59:08 +02:00
cooldome
3b5a504692 parseEnum_regression (#14150)
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-28 19:56:50 +02:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* 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.
2020-04-28 19:56:01 +02:00
Andreas Rumpf
065a6af2de fixes a critical =trace generation bug (see test case) (#14140) 2020-04-27 22:20:14 +02:00
Neelesh Chandola
d38853c504 Undefine paramCount & paramStr in nimscript.nim for *.nims (#12860)
* Remove `paramStr` and `paramCount` from implicitly imported nimscript.nim
* Update changelog.md
* Update stable nimble commit hash

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-04-27 19:16:40 +02:00
PMunch
0e6eb96a5f Fix #14066 issue with stringifying incomplete types (#14135) 2020-04-27 18:43:02 +02:00
Timothee Cour
bb982c644b $(a: float) now works consistently in nim js, avoiding printing floats as ints (#14134)
* fix https://github.com/timotheecour/Nim/issues/133; $(a: float) works in nim js like in other backends

* fix tests

* fix test for windows that prints 1.1e17 differently than other OS
2020-04-27 17:33:03 +02:00
Timothee Cour
b8d7a98265 fix #14132 dsymutil should not be called on static libraries (#14133) [backport:1.2] 2020-04-27 12:39:27 +02:00
hlaaftana
76ffa4fa25 fixes #14112, tests for #12892, #12671, #11697 (#14125) 2020-04-26 10:12:16 +02:00
Viktor Kirilov
018e297d66 HCR: properly handling complex const objects in the codegen - fixes #13915 (#14115) 2020-04-25 20:17:33 +02:00
cooldome
13fa338ada implement (#14114)
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-25 19:59:56 +02:00
hlaaftana
b2141fc2a1 changed type() to typeof() in docs and error messages (#14084) 2020-04-24 09:22:12 +02:00
hlaaftana
dff007f66d Make JS not mangle to snake_case (#14086) 2020-04-24 09:19:54 +02:00
Timothee Cour
66db9de714 CT sizeof(+friends) for {.importc, completeStruct.} types, enable ABI static checks (#13926)
* -d:checkabi obsolete (ABI check now enforced); add `addTypeHeader` helper
* cleanups
* import sizeof at CT for {.completeType.}
* address comments; revert default enabling of -d:checkAbi for now
* mimportc_size_check.nim => msizeof5.nim; merge mabi_check.nim into msizeof5.nim; refactor
* all pragmas in errmsgs should be written: '.importc' (un-ambiguous and less verbose than {.importc.})
2020-04-23 11:24:09 +02:00
Timothee Cour
5c534b2943 new cmd: nim r main [args...] to compile & run, saving binary under $nimcache/main (#13382)
* implement `nim r main` to compile and run, saving binary to $nimcache
* remove outFileAbs for now
2020-04-23 10:02:18 +02:00
Keithcat1
d27bc03b21 Add LTO support for most compilers and do some VCC fixes (#14013)
* Added LTO in nim.cfg, added /link in extccomp.nim and other fixes

* Fix line endings

* Fix line endings, for real this time. Almost certainly. Like, 95% certain.

* Removed /MD from extccom.nim VCC comiler
2020-04-22 23:56:43 +02:00
Andreas Rumpf
269a458d74 cycle collector (#14071)
* figured out the wrong cycle trace proc problem
* cycle collector/break refactorings and minor improvements
2020-04-22 17:34:35 +02:00
Andy Davidoff
9604a5a97a fix typo (#14063) 2020-04-21 23:23:15 -04:00
Araq
dd24004fab cleanup PR #14048 2020-04-21 23:27:19 +02:00
Andreas Rumpf
1b6c4ed2ba fixes #14052 [backport:1.2] (#14055) 2020-04-21 23:19:34 +02:00
cooldome
5db0bb744c Replace enum fields idents with syms (#14048)
* replace enum fields idents with syms
* Trigger build

Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-21 20:12:32 +02:00
Euan
7828199827 #12103 - CI for OpenBSD (#12105)
* Working on OpenBSD CI
* Condense steps into 2 steps to make output easier to follow.
* Move up one directory after csources build.
* Remove FreeBSD build manifest and add OpenBSD test ignores for coroutines and hot code reloading.
* If runCI fails, run the test results script.
* Add email trigger for build failure
* Remove .git from repository URL
* Disable SFML test on OpenBSD
* Disable tgetaddrinfo on OpenBSD as only UDP and TCP protocols are supported.
* Remove getFilePermissions as it causes CI test failures with NimScript.
* Set clang as cc in nim.cfg and use gmake to build csources.
* Add getCurrentDir to nimscript.
* Remove duplicate getCurrentDir and check for not weirdTarget.
* Add CI badge for OpenBSD.
* Disable tests which allocate lots of memory for OpenBSD.
* Use `CORO_BACKEND_SETJMP` on OpenBSD rather than ucontext.
* Simplify building of koch
* Disable t8657 on OpenBSD. See issue #13760.
* Fix #12142 - tarray_of_channels fails on OpenBSD
* Disable thhtpclient_ssl and tosprocterminate on OpenBSD. These tests can be enabled at a later date after fixing them.
* Install libffi.
* Set path to libc for openbsd.
* Disable tevalffi for now.
* Remove tevalffi.nim.
* Use ncpuonline sysctl rather than ncpu.
* Disable tacceptcloserace and tasynchttpserver on OpenBSD.
* Enable tacceptcloserace and tasynchttpserver.
* Fix #13775 as suggested by @alaviss - use /bin/cat on OpenBSD rather than /bin/sh.
* Enable test on OpenBSD.
* Disable tflowvar on OpenBSD.
2020-04-21 15:05:21 +02:00
cooldome
65c5367dc1 Fixes #14014 (#14029)
* add test

* improve test

* progress

* fix #14014

* fix bug

Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-20 15:57:36 +02:00
Jasper Jenkins
ba0af0f827 allow generic typedesc field access (#12220)
Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-04-20 15:36:57 +02:00
Araq
59f1462b95 remove the nilChecks switch; refs #11570 2020-04-20 14:44:54 +02:00
Araq
4d1149cffd fix for asm statement; refs #12650 2020-04-20 14:44:54 +02:00
Timothee Cour
b2720317fa add --experimental:vmopsDanger; add generic conversion for vmops (#13813)
* add --experimental:vmopsDanger; vmops cleanups
2020-04-20 12:00:00 +02:00
alaviss
77834f0fda compiler/suggest: highlight squashed operators (#11796)
The operator fetching proc is greedy, so operators such as `%*` in
expression `%*{}` can't be highlighted.

This commit fixes that.
2020-04-20 11:54:53 +02:00
Andreas Rumpf
73eff1f457 fixes #12741 (#14005)
* fixes #12741
* updated tests
2020-04-19 11:59:01 +02:00
Andreas Rumpf
9874981e75 fixes #14001 (#14004) 2020-04-19 10:01:04 +02:00
Arne Döring
4005f0d0e4 forward type alignment information to seqs (#12430) 2020-04-19 07:52:01 +02:00
cooldome
d839eb9352 fix #14007 (#14012) [backport]
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-18 16:15:17 +02:00
cooldome
f10689d3d4 fixes #14003 (#14006) [backport:1.2]
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-17 13:23:04 +02:00
cooldome
d3b0132061 Step2: fixes #13781, fixes #13805 (#13897)
* Fix sym owner in wrapper proc
* threadpool changes
* revert lowerings
* add newFastMoveStmt
* try fixing test by switching to cpp

Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-16 23:27:08 +02:00
cooldome
9295251e68 Implements RFCs #209 (#13995)
* add test
* add changelod entry
Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-04-16 21:04:05 +02:00
Andreas Rumpf
3a2697dd73 drnim: tiny progress (#13882)
* drnim: tiny progress
* refactoring complete
* drnim: prove .ensures annotations
* Moved code around to avoid code duplication
* drnim: first implementation of the 'old' property
* drnim: be precise about the assignment statement
* first implementation of --assumeUnique
* progress on forall/exists handling
2020-04-15 20:03:25 +02:00