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

allows 'let importc' variables (needs to be documented) #14321

Closed
wants to merge 1 commit into from

Conversation

Araq
Copy link
Member

@Araq Araq commented May 12, 2020

No description provided.

@timotheecour
Copy link
Member

timotheecour commented May 12, 2020

you can add this test, it passes

discard """
targets: "c cpp js"
"""

when defined(c) or defined(cpp):
  {.emit:"""
  const int foo1 = 123;
  """.}

when defined(js):
  {.emit:"""
  const foo1 = 123;
  """.}

let foo1 {.importc, nodecl.}: cint
doAssert foo1 == 123

(also good to reference #14258 and #14253)

@Araq
Copy link
Member Author

Araq commented May 12, 2020

PR only existed to show @PMunch

@PMunch
Copy link
Contributor

PMunch commented May 12, 2020

Liked your testcase @timotheecour so I added it in #14258

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

Successfully merging this pull request may close these issues.

3 participants