ast: minor cleanup in is_comptime_type() (#14759)

master
yuyi 2022-06-14 19:21:45 +08:00 committed by GitHub
parent e4e858b132
commit 7c50d276c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 17 deletions

View File

@ -2119,25 +2119,11 @@ pub fn (t &Table) is_comptime_type(x Type, y ComptimeType) bool {
return x_kind == .map return x_kind == .map
} }
.int { .int {
return x_kind in [ return x_kind in [.i8, .i16, .int, .i64, .u8, .u16, .u32, .u64, .usize, .isize,
.i8, .int_literal]
.i16,
.int,
.i64,
.u8,
.u16,
.u32,
.u64,
.usize,
.int_literal,
]
} }
.float { .float {
return x_kind in [ return x_kind in [.f32, .f64, .float_literal]
.f32,
.f64,
.float_literal,
]
} }
.struct_ { .struct_ {
return x_kind == .struct_ return x_kind == .struct_