checker: cleanup type alias pascal case check (#10217)

pull/10233/head
Enzo 2021-05-27 21:40:32 +02:00 committed by GitHub
parent a095a27d00
commit df2b688337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -5,8 +5,6 @@ module time
#include <time.h>
type time_t = i64
pub const (
days_string = 'MonTueWedThuFriSatSun'
month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

View File

@ -18,7 +18,7 @@ struct C.tm {
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.localtime_r(t &time_t, tm &C.tm)

View File

@ -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) {
// TODO Replace `c.file.mod.name != 'time'` by `it.language != .v` once available
if c.file.mod.name !in ['time', 'builtin'] {
// TODO Remove when `u8` isn't an alias in builtin anymore
if c.file.mod.name != 'builtin' {
c.check_valid_pascal_case(node.name, 'type alias', node.pos)
}
c.ensure_type_exists(node.parent_type, node.type_pos) or { return }