checker: do not allow aliases of `chan` types (#6294)

pull/6300/head
Uwe Krüger 2020-09-03 02:03:31 +02:00 committed by GitHub
parent cc714ca5cc
commit b8617ace53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -269,6 +269,8 @@ pub fn (mut c Checker) type_decl(node ast.TypeDecl) {
orig_sym := c.table.get_type_symbol((typ_sym.info as table.Alias).parent_type)
c.error('type `$typ_sym.str()` is an alias, use the original alias type `$orig_sym.source_name` instead',
node.pos)
} else if typ_sym.kind == .chan {
c.error('aliases of `chan` types are not allowed.', node.pos)
}
}
ast.FnTypeDecl {