winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.6k stars 180 forks source link

Cannot use `datetime` or `regex` as a type annotation #6376

Open Chriscbr opened 2 weeks ago

Chriscbr commented 2 weeks ago

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