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

Allow typedesc assignments with let/var at "compile time". #10004

Closed
deech opened this issue Dec 15, 2018 · 3 comments
Closed

Allow typedesc assignments with let/var at "compile time". #10004

deech opened this issue Dec 15, 2018 · 3 comments

Comments

@deech
Copy link
Contributor

deech commented Dec 15, 2018

Currently typedesc assignments are only allowed with const variables, but they should also be allowed with let/var so long as they are in a static/const/when context:

const C = 
  block:
    let t : typedesc[int] = int
    ...

when(
  block:
    let t : typedesc[int] = int
    true
):
  ...

static:
  let t : typedesc[int] = int
  ...
@mratsim
Copy link
Collaborator

mratsim commented Dec 16, 2018

Shouldn't we use type t: type int = int anyway?

@deech
Copy link
Contributor Author

deech commented Dec 16, 2018

I had no idea that syntax existed.

@krux02
Copy link
Contributor

krux02 commented Aug 19, 2019

yes use type definitions please.

@krux02 krux02 closed this as completed Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants