Fix crash when proc return type is undeclared parapoly variable

Disallow the declaration of new parapoly variables in return types, when
the procedure's parapoly scope is itself. This happens if e.g.:
`foo :: proc() -> $T`.

Closes #3949, #4294, #4563
This commit is contained in:
Roland Kovacs
2024-12-22 02:31:25 +01:00
parent 597fba7c31
commit f2f952b344
2 changed files with 9 additions and 1 deletions
+1
View File
@@ -521,6 +521,7 @@ struct CheckerContext {
bool in_enum_type;
bool collect_delayed_decls;
bool allow_polymorphic_types;
bool disallow_polymorphic_return_types; // NOTE(zen3ger): no poly type decl in return types
bool no_polymorphic_errors;
bool hide_polymorphic_errors;
bool in_polymorphic_specialization;