Browse Source

Merge pull request #3899 from laytan/fix-more-attributes-not-applied-to-poly-procs

fix optimization mode, cold, and disabled not being applied to poly procs
gingerBill 1 year ago
parent
commit
5aa1f3751b
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/check_expr.cpp

+ 10 - 0
src/check_expr.cpp

@@ -587,6 +587,16 @@ gb_internal bool find_or_generate_polymorphic_procedure(CheckerContext *old_c, E
 	entity->file = base_entity->file;
 	entity->file = base_entity->file;
 	entity->pkg = base_entity->pkg;
 	entity->pkg = base_entity->pkg;
 	entity->flags = 0;
 	entity->flags = 0;
+
+	entity->Procedure.optimization_mode = base_entity->Procedure.optimization_mode;
+
+	if (base_entity->flags & EntityFlag_Cold) {
+		entity->flags |= EntityFlag_Cold;
+	}
+	if (base_entity->flags & EntityFlag_Disabled) {
+		entity->flags |= EntityFlag_Disabled;
+	}
+
 	d->entity = entity;
 	d->entity = entity;
 
 
 	AstFile *file = nullptr;
 	AstFile *file = nullptr;