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

Cannot use datetime or regex as a type annotation #6376

Open
Chriscbr opened this issue Apr 29, 2024 · 0 comments
Open

Cannot use datetime or regex as a type annotation #6376

Chriscbr opened this issue Apr 29, 2024 · 0 comments
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler 🙋‍♀️ help wanted Extra attention is needed

Comments

@Chriscbr
Copy link
Contributor

Chriscbr commented Apr 29, 2024

I tried this:

let hello_world = inflight (x: datetime) => {
  log(x.toIso());
};

let y: datetime = datetime.utcNow();

This happened:

A compilation error

error: Unknown symbol "datetime"
  --> wing/main.w:1:32
  |
1 | let hello_world = inflight (x: datetime) => {
  |                                ^^^^^^^^ Unknown symbol "datetime"


error: Unknown symbol "datetime"
  --> wing/main.w:5:8
  |
5 | let y: datetime = datetime.utcNow();
  |        ^^^^^^^^ Unknown symbol "datetime"

I expected this:

No error

Is there a workaround?

use std.Datetime or std.Regex

Anything else?

No response

Wing Version

0.72.12

Node.js Version

20.11.1

Platform(s)

MacOS

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@Chriscbr Chriscbr added 🐛 bug Something isn't working 🙋‍♀️ help wanted Extra attention is needed 🛠️ compiler Compiler labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler 🙋‍♀️ help wanted Extra attention is needed
Projects
Status: 🤝 Backlog - handoff to owners
Development

No branches or pull requests

1 participant