diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-29 20:56:18 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-29 20:56:18 +0100 |
| commit | 69f7382eec47cf5c60ba013c49bcc2a5f7f6a279 (patch) | |
| tree | c7fa91f6500c48ac4b65c856878b700d7c6a183f /src/check_stmt.cpp | |
| parent | 7e3293fc20592bf978b3cb9ceeeb0d88590b2909 (diff) | |
Implicit parametric polymorphic procedures
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 3 |
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; } } |