fix structs that contain types which require comptime
Now, if a struct has any fields which require comptime, such as `type`, then the struct is marked as requiring comptime as well. Same goes for unions. This means that a function will implicitly be called at comptime if the return type is a struct which contains a field of type `type`. closes #586
This commit is contained in:
@@ -3329,7 +3329,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
|
||||
".tmp_source.zig:9:4: error: variable of type 'comptime_float' must be const or comptime",
|
||||
".tmp_source.zig:10:4: error: variable of type '(block)' must be const or comptime",
|
||||
".tmp_source.zig:11:4: error: variable of type '(null)' must be const or comptime",
|
||||
".tmp_source.zig:12:4: error: variable of type 'Opaque' must be const or comptime",
|
||||
".tmp_source.zig:12:4: error: variable of type 'Opaque' not allowed",
|
||||
".tmp_source.zig:13:4: error: variable of type 'type' must be const or comptime",
|
||||
".tmp_source.zig:14:4: error: variable of type '(namespace)' must be const or comptime",
|
||||
".tmp_source.zig:15:4: error: variable of type '(bound fn(*const Foo) void)' must be const or comptime",
|
||||
|
||||
Reference in New Issue
Block a user