-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
bugSomething isn't workingSomething isn't workingmojoIssues that are related to mojoIssues that are related to mojomojo-repoTag all issues with this labelTag all issues with this label
Description
Bug description
Recently on Nightly we are allowed to implicitly create a variable, without the var
keyword. Still we cannot annotate those variables with a type, or create a uninitialized variable.
Steps to reproduce
struct Foo:
var i: Int
fn __init__(inout self, i: Int):
self.i = i
fn m():
# No Annotations
var f3 = Foo(1) # ok
f4 = Foo(1) # ok
# With Annotations
var f5: Foo = 1 # ok
f5: Foo = 1 # fails
# Uninitialized
var f: Foo # ok
f2: Foo # fails
System information
- Sonoma 14.5 Mac M1
- mojo 2024.8.2419 (1fdb01e1)
- modular 0.9.2 (b3079bd5)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmojoIssues that are related to mojoIssues that are related to mojomojo-repoTag all issues with this labelTag all issues with this label