From 69f7382eec47cf5c60ba013c49bcc2a5f7f6a279 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Thu, 29 Jun 2017 20:56:18 +0100 Subject: Implicit parametric polymorphic procedures --- src/check_stmt.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/check_stmt.cpp') diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 33cfd3dfa..d197e02d5 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1717,6 +1717,9 @@ void check_stmt_internal(Checker *c, AstNode *node, u32 flags) { init_type = check_type(c, vd->type, NULL); if (init_type == NULL) { init_type = t_invalid; + } else if (is_type_polymorphic(init_type)) { + error(vd->type, "Invalid use of a polymorphic type in variable declaration"); + init_type = t_invalid; } } -- cgit v1.2.3