From b8617ace5337fb3a84457f1fa50214e34d127994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kr=C3=BCger?= <45282134+UweKrueger@users.noreply.github.com> Date: Thu, 3 Sep 2020 02:03:31 +0200 Subject: [PATCH] checker: do not allow aliases of `chan` types (#6294) --- vlib/v/checker/checker.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index f2d0ddad80..fc3e0b4710 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -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 {