fix assigning value to type
This commit is contained in:
@@ -9,8 +9,9 @@ Vec4 :: Vector(4,f32);
|
|||||||
|
|
||||||
main :: () {
|
main :: () {
|
||||||
x : Type = f64;
|
x : Type = f64;
|
||||||
v:f64 = 3.2;
|
|
||||||
print("{}\n", x);
|
print("{}\n", x);
|
||||||
|
|
||||||
|
v:f64 = 3.2;
|
||||||
print("{}\n", v);
|
print("{}\n", v);
|
||||||
|
|
||||||
x = Vec4;
|
x = Vec4;
|
||||||
@@ -18,6 +19,7 @@ main :: () {
|
|||||||
|
|
||||||
x = test;
|
x = test;
|
||||||
print("{}\n", x);
|
print("{}\n", x);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ** stdout **
|
// ** stdout **
|
||||||
|
|||||||
@@ -2056,6 +2056,7 @@ pub const CodeGen = struct {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
return self.emitErrorFmt("cannot assign non-type value to Type variable '{s}'", .{name});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Union reassignment: s = .circle(3.14) or s = .none
|
// Union reassignment: s = .circle(3.14) or s = .none
|
||||||
|
|||||||
Reference in New Issue
Block a user