You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const std = @import("std");
const math = std.math;
pub fn Gen(comptime val: u32) type
{
const UType = @IntType(false, math.ceil(val));
const S = struct
{
code_len: UType,
};
return S;
}
test "Crash"
{
const G = Gen(8);
}
I haven't been able to minimize the circumstances further than the above. As you can see, math.ceil is passed an incorrect type and should produce an error message communicating that. For some reason, this specific construction instead causes a compiler crash.
The text was updated successfully, but these errors were encountered:
andrewrk
added
the
bug
Observed behavior contradicts documented or intended behavior
label
Sep 7, 2018
tgschultz
changed the title
Compiler crash with @IntType under specific circumstances
Compiler crash when generated struct includes field of generated type from fn containing undeclared identifier
Sep 7, 2018
I haven't been able to minimize the circumstances further than the above. As you can see, math.ceil is passed an incorrect type and should produce an error message communicating that. For some reason, this specific construction instead causes a compiler crash.
The text was updated successfully, but these errors were encountered: