checker, builtin: prepage for builtin channels (#6262)

pull/6266/head
Uwe Krüger 2020-08-30 08:55:31 +02:00 committed by GitHub
parent d88e8bb9ea
commit c351f8fa47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -197,7 +197,7 @@ Did you forget to add vlib to the path? (Use @vlib for default vlib)')
}
pub fn (v &Builder) get_user_files() []string {
if v.pref.path in ['vlib/builtin', 'vlib/strconv', 'vlib/strings', 'vlib/hash'] {
if v.pref.path in ['vlib/builtin', 'vlib/strconv', 'vlib/strings', 'vlib/hash', 'vlib/time'] {
// This means we are building a builtin module with `v build-module vlib/strings` etc
// get_builtin_files() has already added the files in this module,
// do nothing here to avoid duplicate definition errors.

View File

@ -53,6 +53,9 @@ pub fn (mut p Parser) parse_map_type() table.Type {
pub fn (mut p Parser) parse_chan_type() table.Type {
p.next()
if p.tok.kind != .name && p.tok.kind != .key_mut && p.tok.kind != .amp {
return table.chan_type
}
elem_type := p.parse_type()
idx := p.table.find_or_register_chan(elem_type)
return table.new_type(idx)

View File

@ -13,7 +13,7 @@ pub const (
// math.bits is needed by strconv.ftoa
pub const (
builtin_module_parts = ['math.bits', 'strconv', 'strconv.ftoa', 'hash', 'strings', 'builtin']
builtin_module_parts = ['math.bits', 'strconv', 'strconv.ftoa', 'hash', 'strings', 'time', 'builtin']
)
pub const (