1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: allow EnumName(number) casts only inside unsafe{} blocks (#15932)

This commit is contained in:
Swastik Baranwal
2022-10-03 01:09:11 +05:30
committed by GitHub
parent 7993f0bf39
commit b584e1df98
32 changed files with 129 additions and 97 deletions

View File

@@ -151,7 +151,7 @@ pub fn get_str_intp_u32_format(fmt_type StrIntpType, in_width int, in_precision
[manualfree]
fn (data &StrIntpData) process_str_intp_data(mut sb strings.Builder) {
x := data.fmt
typ := StrIntpType(x & 0x1F)
typ := unsafe { StrIntpType(x & 0x1F) }
allign := int((x >> 5) & 0x01)
upper_case := ((x >> 7) & 0x01) > 0
sign := int((x >> 8) & 0x01)