Commit Graph

131 Commits

Author SHA1 Message Date
quantimnot
f7a13f62d6 Stop type aliases from inheriting sfUsed (#19861)
Fixes #18201

Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
2022-06-04 06:25:21 +02:00
flywind
d102b2f54c deprecate unsafeAddr; extend addr (#19373)
* deprecate unsafeAddr; extend addr

addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr

* follow @Vindaar's advice

* change the signature of addr

* unsafeAddr => addr (stdlib)

* Update changelog.md

* unsafeAddr => addr (tests)

* Revert "unsafeAddr => addr (stdlib)"

This reverts commit ab83c99c50.

* doc changes; thanks to @konsumlamm

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-01-16 11:08:38 +01:00
flywind
9df195ef58 style usages part one (openarray => openArray) (#19321)
* style usages (openArray)

* revert doc changes
2022-01-04 13:29:50 +01:00
Emery Hemingway
5fd150b7f7 asynchttpserver: ipv6 support (#18706)
Fix #18705
2021-08-18 14:25:25 +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
cc0f02d57d rename nimFpRoundtrips => nimPreviewFloatRoundtrip (#18566) 2021-07-23 14:57:47 -07:00
Timothee Cour
cf0cf32d27 make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)
* compiler/vmhooks: add getVar to allow vmops with var params
* addFloat vmops with var param
* cgen now renders float32 literals in c backend using roundtrip float to string
2021-07-20 22:13:52 +02:00
Andreas Rumpf
25efb53862 make dragonbox opt-in via -d:nimFpRoundtrips (#18504)
* make dragonbox opt-in via -d:nimFpRoundtrips

* make tests green again

* make tests green again
2021-07-16 18:29:49 +02:00
Timothee Cour
836b061ae3 improve --declaredLocs to help disambiguate types (generics, aliases etc) (#18389)
* improve --declaredlocs to help disambiguate types (generics, aliases etc)

* avoid a cyclic deps

* fix test after rebase
2021-07-08 12:28:06 +02:00
Jason Beetham
252eea8cae Make procedure mismatch more informative with pragma/call convention mismatches (#18384)
* Added more concise calling convention/pragma mismatch messages
* Now only adds callConvMsg/lock message  when sensible
* Fixed message formatting
* Added tests, and fixed some bugs
* Tests joined, and always indenting
* More tests and more bug fixes
* Fixed first test in tprocmismatch
* Using var param for writting mismatches
* Better logic for handling proc type rel and conv/pragma mismatch
* Refactored getProcConvMismatch
* Fixed callConv message formatting
* Fixed test for proper message
* Cleanup to address issues
* getProcConvMismatch now returns tuple, and reformatted code
2021-07-06 07:28:38 +02:00
Kaushal Modi
f128f7971f float parsing: Add test for a fixed issue (#18232)
Fixes https://github.com/nim-lang/Nim/issues/14407 .

This issue was fixed by https://github.com/nim-lang/Nim/pull/18139.
2021-06-24 19:19:50 +02:00
Timothee Cour
f258e4e70c fix #18332: XDeclaredButNotUsed hints now in deterministic order (#18336) 2021-06-24 08:31:55 +02:00
flywind
037715285c fix #18327 (#18328) 2021-06-22 12:44:56 +02:00
Timothee Cour
8ef6073543 add test case for pure enum redefinition error within enum (fixed in recent PR) (#18266)
* add test case for pure enum redefinition error within enum (fixed in recent PR)

* remove code duplication

* Revert "remove code duplication" (would require bootstrap >= 1.4)

This reverts commit 3f793874c2.

* fixup
2021-06-15 08:56:10 +02:00
Clyybber
8c42f5be02 Small scope refactoring (#18263)
* Small scope refactoring

* Add test for #10251

* Add inline where appropriate
2021-06-14 19:19:58 +02:00
Timothee Cour
065243dc59 followup #17777: declaredloc field error msgs now work with generics (#18259)
* followup #17777: declaredloc field error msgs now work with generics

* fix tests

* cleanup
2021-06-14 08:21:18 +02:00
Timothee Cour
3619a5a2aa more informative error msg for undeclared field (A(badfield: 1) and a.badfield = expr) (#17777) 2021-05-16 10:03:22 -07:00
Timothee Cour
93c26041a5 fix #17859; rename tests so they run in CI; merge several tests with nim check (#17862)
* rename a test so it runs in CI; merge several tests with nim check

* continue

* continue

* continue

* rename tests/errmsgs/undeclared_routine_compiles.nim -> tests/errmsgs/tundeclared_routine_compiles.nim
2021-04-27 10:42:24 +02:00
Timothee Cour
f52aa6bde8 fix typo in test name undeclared_routime.nim => undeclared_routine.nim (#17861) 2021-04-26 11:32:41 -07:00
Timothee Cour
ae9231cfeb fix CI tests/errmsgs/tgcsafety.nim (#17721) 2021-04-14 13:45:25 -07:00
Timothee Cour
d6242d7fe1 simplify asyncfutures, asyncmacro (#17633) 2021-04-14 21:22:22 +02:00
flywind
7bfb9f0002 close #17636 (#17643) 2021-04-06 16:20:01 +02:00
flywind
70a30317f7 fix #16693: testament spec nimout too lax (#16698)
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-04-04 13:47:28 -07:00
Timothee Cour
4a11a04fba fix #14850: repr now correctly renders do (#17623)
* fix #14850: `repr` now correctly renders `do`

* add tests

* fix test
2021-04-03 16:05:37 +02:00
flywind
3f9c51a332 [nim check]fix #17460 (#17569) 2021-03-29 09:28:55 -07:00
Saem Ghani
260a5dacb7 fixed dot operator recursive loop & macro suggest (#16922)
* basic stability improvements; refs nimsuggest
* fixed dot operator recursive loop & macro suggest
* hacky fix for run away dot operator sem check

Committing this mostly to make the issue more clear. Perhaps get better
feedback.

* semExprWithType seems like a better place to check
* fixed error messages const case expressions
* Clean-up test
* stopped the dot operator madness

No longer get infinite recursion when seming broken code with a dot
operator macro like in jsffi.

Co-authored-by: Araq <rumpf_a@web.de>
2021-02-15 09:51:05 +01:00
Timothee Cour
e40ff24c23 typeToString: type float => typedesc[float] (#17011)
* typeToString: type float => typedesc[float]

* fixup

* fix tests
2021-02-12 17:10:20 +01:00
flywind
4e1e231e29 fix floats slice (#16853)
* see whether it breaks

* fix

* fix

* minor

* fix

* add enum

* use Ordinal types

* fix tests

* fix

* another style

* fix remainning cases
2021-01-29 12:26:36 +01:00
flywind
e4a529962e close #10735 add testcase (#16690) 2021-01-15 22:23:49 -08:00
flywind
736b0d13c0 close #10734 add testcase (#16692)
* close #10734 add testcase

* fix

* fix
2021-01-12 12:10:22 +01:00
ee7
84fea7c144 strutils.nim: Use func everywhere (#16281)
* strutils.nim: procs with {.noSideEffect.} -> func

* strutils.nim: procs without {.noSideEffect.} -> func

* strutils.nim: proc -> func for links

* strutils.nim: proc -> func in doc comments

* test: add strutils to strictFuncs test

* test: proc -> func in errmsg test
2020-12-07 17:07:12 +01:00
Timothee Cour
31a8cf16bb testament spec: remove errmsg alias of errormsg (#16188) 2020-11-29 17:32:34 -08:00
Andreas Rumpf
122f22d163 asynchttpserver cleanups [backport:1.0] (#15966)
* asynchttpserver cleanups [backport:1.0]
2020-11-15 07:27:13 +01:00
Araq
fa7b12bcf9 makes test green again 2020-11-13 14:18:01 +01:00
Timothee Cour
0fb878324e honor --declaredLocs in more places, including type mismatch errors; also show kind with --declaredLocs (#15673)
* honor --declaredLocs in more places, including type mismatch errors
* fix tests
* show declaration location also when type mismatch names clash
2020-10-27 14:19:28 +01:00
Andreas Rumpf
3b901d1e36 docgen: improve alignment of comments (still not perfect) (#15506)
* docgen: improve alignment of comments (still not perfect)

* fix error message text in `tunknown_named_parameter`

Co-authored-by: narimiran <narimiran@disroot.org>
2020-10-07 14:39:13 +02:00
flywind
086efac49b fix #6608 (#14963)
* fix #6608
2020-07-14 09:22:48 +02:00
Timothee Cour
a6cbe58e8c typetraits.$: $((int, float), int) is now "((int, float), int)" instead of "(tuple of (int, float), int)" (#14812)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-07-02 16:19:43 +02:00
cooldome
e5b64af831 Implement rendering of []=, {}, {}= braces (#14539)
* render curly braces
* fix typo
* fix test

Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-06-01 19:56:17 +02:00
Neelesh Chandola
4c08e64e98 disallow typedesc in arrays & move existing checks to types.typeAllowedAux (#13261)
* disallow typedesc in arrays and move previous checks to types.typeAllowedAux
2020-05-29 11:48:15 +02:00
Araq
7f1d2489ad improve the 'has to be discarded' error message 2020-05-02 22:31:19 +02:00
Andreas Rumpf
73eff1f457 fixes #12741 (#14005)
* fixes #12741
* updated tests
2020-04-19 11:59:01 +02:00
Arne Döring
64ffa17f0f fixes #13715 (#13716)
* fixes #13715

* fix test
2020-03-22 20:01:01 +01:00
Timothee Cour
dd362ab4c0 fix #13538 sigmatch errors are now sorted (#13701)
* fix #13538 sigmatch now sorted and has reliable order

* re-enable tests that were disabled because of that bug

* fix remaining tests and un-disable 2 other tests that were affected by this bug
2020-03-20 09:28:03 +01:00
Andreas Rumpf
83e715c5b6 fixes #5170 (#13589)
* fixes #5170

* make tests green
2020-03-05 16:02:34 +01:00
Timothee Cour
eec07b4e84 fix several bugs with repr (#13386) 2020-02-11 21:33:06 +01:00
Timothee Cour
e4415422fe Revert "printing float values will have one more digit. (#13276) [backport]" (#13363)
This reverts commit b2c6db97f9.
2020-02-08 09:30:24 +01:00
Arne Döring
b2c6db97f9 printing float values will have one more digit. (#13276) [backport]
* printing float values will have one more digit. Fixes #13196
2020-02-07 17:10:25 +01:00
Timothee Cour
79ec8c2571 fix #13182: proc fun(a: varargs[Foo, conv]) now can be overloaded (#13345) [backport] 2020-02-07 13:29:18 +01:00
Neelesh Chandola
7ebb2baa6c Assigning template to var/let/const gives a proper error (#12851)
* Assigning template to var/let/const gives a proper error

* Fix style
2019-12-09 08:19:40 +00:00