From df2b68833791d539e7b25b496d5371f5516995d6 Mon Sep 17 00:00:00 2001 From: Enzo Date: Thu, 27 May 2021 21:40:32 +0200 Subject: [PATCH] checker: cleanup type alias pascal case check (#10217) --- vlib/time/time.v | 2 -- vlib/time/time_nix.c.v | 2 +- vlib/v/checker/checker.v | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/vlib/time/time.v b/vlib/time/time.v index c6e4503f1f..0b80b26aac 100644 --- a/vlib/time/time.v +++ b/vlib/time/time.v @@ -5,8 +5,6 @@ module time #include -type time_t = i64 - pub const ( days_string = 'MonTueWedThuFriSatSun' month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] diff --git a/vlib/time/time_nix.c.v b/vlib/time/time_nix.c.v index cf9f80dde3..d9efe4b521 100644 --- a/vlib/time/time_nix.c.v +++ b/vlib/time/time_nix.c.v @@ -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) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 50bc61ce03..80c4907382 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -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 }