Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecation syntax inconsistent for objects, not possible for const/let/var #9331

Closed
timotheecour opened this issue Oct 12, 2018 · 3 comments · Fixed by #20115
Closed

deprecation syntax inconsistent for objects, not possible for const/let/var #9331

timotheecour opened this issue Oct 12, 2018 · 3 comments · Fixed by #20115
Labels

Comments

@timotheecour
Copy link
Member

  • {.deprecated: "msg" .} works for routines/types but not for const/let/var:
block:
  # works
  const Foo {.deprecated.}  = 1

block:
  # Error: annotation to deprecated not supported here
  # const Foo {.deprecated: "bla".}  = 1
  • deprecated for object type inconsistent all other deprecated forms:
    for pretty much everything, {.deprecated: "blabla".} goes before the = but not for object type:
block:
  # object type: deprecated goes after `=`
  type Foo = object {.deprecated: "blabla".}
    a: int

block:
  # every thing else: deprecated goes before `=`: enum, routines, const/let/var
  type Foo {.deprecated: "asdf" .} = enum
    a
@alaviss
Copy link
Collaborator

alaviss commented Oct 14, 2018

This could have been separated to two issues, each with a small, not an essay title:

  • deprecated pragma with annotation doesn't work for variables
  • deprecated pragma is inconsistant for object type

Seriously, you should start minimizing your issue title to not scare people away, avoiding symbols might be a good start. Just my 2¢.

@timotheecour
Copy link
Member Author

timotheecour commented Oct 14, 2018

Seriously, you should start minimizing your issue title to not scare people away, avoiding symbols might be a good start. Just my 2¢.

I understand your points and will keep in mind; there's a tradeoff between precision and conciseness; regarding symbols, {.deprecated: "msg" .} may make it easier to search (via {.deprecated: ") compared to deprecated pragma with annotation (lots of synonyms in english) when searching with in:title but YMMV
likewise with grouping vs splitting related issues; in some similar past cases others were recommending grouping instead; so it's not completely obvious.

@krux02 krux02 changed the title {.deprecated: "msg" .} works for routines/types but not for const/let/var; deprecated for object type inconsistent all other deprecated forms deprecation syntax inconsistent for objects, not possible for const/let/var Oct 29, 2018
@nc-x
Copy link
Contributor

nc-x commented Dec 28, 2018

Part 2 fixed by - 05b8085
Part 1 - PR #10110 These symbols do not store enough information currently so the patch does not work (more information). Patch added for vars/lets #10234
Only remaining issue is const

@GULPF GULPF added the Pragmas label Jun 7, 2019
metagn added a commit to metagn/Nim that referenced this issue Jul 31, 2022
…20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc
metagn added a commit to metagn/Nim that referenced this issue Sep 23, 2022
…20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc
Araq pushed a commit that referenced this issue Sep 28, 2022
* continue #9582 for consts, close #9331, fix #20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc

* changelog correctly

* fix jsgen

* update tgetimpl

* fix sighashes

* fix #19766, add comment about postfix

* fix noRewrite LOL

refs #16620

* fix changelog

* fix destructors
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
* continue nim-lang#9582 for consts, close nim-lang#9331, fix nim-lang#20114

also move extractPragma to ast to pave the way for things like {.strdefine: "abc".} etc

* changelog correctly

* fix jsgen

* update tgetimpl

* fix sighashes

* fix nim-lang#19766, add comment about postfix

* fix noRewrite LOL

refs nim-lang#16620

* fix changelog

* fix destructors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants