checker: cleanup type alias pascal case check (#10217)
parent
a095a27d00
commit
df2b688337
|
@ -5,8 +5,6 @@ module time
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
type time_t = i64
|
|
||||||
|
|
||||||
pub const (
|
pub const (
|
||||||
days_string = 'MonTueWedThuFriSatSun'
|
days_string = 'MonTueWedThuFriSatSun'
|
||||||
month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct C.tm {
|
||||||
tm_isdst int
|
tm_isdst int
|
||||||
}
|
}
|
||||||
|
|
||||||
fn C.timegm(&C.tm) time_t
|
fn C.timegm(&C.tm) C.time_t
|
||||||
|
|
||||||
// fn C.gmtime_r(&tm, &gbuf)
|
// fn C.gmtime_r(&tm, &gbuf)
|
||||||
fn C.localtime_r(t &time_t, tm &C.tm)
|
fn C.localtime_r(t &time_t, tm &C.tm)
|
||||||
|
|
|
@ -311,8 +311,8 @@ pub fn (mut c Checker) type_decl(node ast.TypeDecl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn (mut c Checker) alias_type_decl(node ast.AliasTypeDecl) {
|
pub fn (mut c Checker) alias_type_decl(node ast.AliasTypeDecl) {
|
||||||
// TODO Replace `c.file.mod.name != 'time'` by `it.language != .v` once available
|
// TODO Remove when `u8` isn't an alias in builtin anymore
|
||||||
if c.file.mod.name !in ['time', 'builtin'] {
|
if c.file.mod.name != 'builtin' {
|
||||||
c.check_valid_pascal_case(node.name, 'type alias', node.pos)
|
c.check_valid_pascal_case(node.name, 'type alias', node.pos)
|
||||||
}
|
}
|
||||||
c.ensure_type_exists(node.parent_type, node.type_pos) or { return }
|
c.ensure_type_exists(node.parent_type, node.type_pos) or { return }
|
||||||
|
|
Loading…
Reference in New Issue