-
Notifications
You must be signed in to change notification settings - Fork 211
Closed
Labels
good first issueGood for newcomersGood for newcomers🐛 bugSomething isn't workingSomething isn't working🛠️ compilerCompilerCompiler
Description
I tried this
Tried creating empty arrays, using both automatically inferred types and explicitly defining the types.
let x: Array<num> = [];
let y = [];
Expected
let x: Array<num> = [];
The code above should work as is.
let x = [];
The code above should, maybe, infer an array of anys.
Instead, this happened
There was a compilation error:
Compilation failed with 2 errors
Error at code.w:1:21 | Cannot infer type of empty array
Error at code.w:2:9 | Cannot infer type of empty array
Component
Compiler
Environment
- Wing Version: 0.4.26
- OS: MacOS
- Node version: 18.12.1Sub tasks
-
let x: Array<num> = [];should compile correctly -
let arr = new Array<num>();should compile correctly
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers🐛 bugSomething isn't workingSomething isn't working🛠️ compilerCompilerCompiler
Type
Projects
Status
✅ Done