diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-06-07 17:26:41 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-06-07 18:07:30 -0400 |
| commit | 31aefa6a2179dfae752020195fb193c6333bae7e (patch) | |
| tree | 3bf77a35c39424e736da020a0451d6fe32d7648b /test/compile_errors.zig | |
| parent | b11c5d8f8256fc19e08eacfc50be209878f00e73 (diff) | |
| download | zig-31aefa6a2179dfae752020195fb193c6333bae7e.tar.gz zig-31aefa6a2179dfae752020195fb193c6333bae7e.zip | |
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
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index c995cd679e..102c4e428d 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -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", |
