aboutsummaryrefslogtreecommitdiff
path: root/src/check_stmt.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-29 20:56:18 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-29 20:56:18 +0100
commit69f7382eec47cf5c60ba013c49bcc2a5f7f6a279 (patch)
treec7fa91f6500c48ac4b65c856878b700d7c6a183f /src/check_stmt.cpp
parent7e3293fc20592bf978b3cb9ceeeb0d88590b2909 (diff)
Implicit parametric polymorphic procedures
Diffstat (limited to 'src/check_stmt.cpp')
-rw-r--r--src/check_stmt.cpp3
1 files changed, 3 insertions, 0 deletions
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;
}
}