diff options
Diffstat (limited to 'src/parser/parser_decl.c')
| -rw-r--r-- | src/parser/parser_decl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser/parser_decl.c b/src/parser/parser_decl.c index c5df863..48077e1 100644 --- a/src/parser/parser_decl.c +++ b/src/parser/parser_decl.c @@ -56,6 +56,13 @@ ASTNode *parse_function(ParserContext *ctx, Lexer *l, int is_async) strcat(buf, ","); } strcat(buf, s); + + // Check for shadowing + if (is_known_generic(ctx, s)) + { + zpanic_at(gt, "Generic parameter '%s' shadows an existing generic parameter", s); + } + free(s); if (lexer_peek(l).type == TOK_COMMA) |
