Browse Source

[typer] fix overload meta on overload (#9819)

Dmitrii Maganov 5 years ago
parent
commit
25b1e0cd3f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/typing/typeloadFields.ml

+ 1 - 1
src/typing/typeloadFields.ml

@@ -1609,7 +1609,7 @@ let init_class ctx c p context_init herits fields =
 						let mainf = PMap.find cf.cf_name (if fctx.is_static then c.cl_statics else c.cl_fields) in
 						let mainf = PMap.find cf.cf_name (if fctx.is_static then c.cl_statics else c.cl_fields) in
 						if is_var mainf then display_error ctx "Cannot declare a variable with same name as a method" mainf.cf_pos;
 						if is_var mainf then display_error ctx "Cannot declare a variable with same name as a method" mainf.cf_pos;
 						(if not (has_class_field_flag mainf CfOverload) then display_error ctx ("Overloaded methods must have @:overload metadata") mainf.cf_pos);
 						(if not (has_class_field_flag mainf CfOverload) then display_error ctx ("Overloaded methods must have @:overload metadata") mainf.cf_pos);
-						mainf.cf_overloads <- cf :: mainf.cf_overloads
+						mainf.cf_overloads <- cf :: cf.cf_overloads @ mainf.cf_overloads
 					else
 					else
 						let type_kind,path = match c.cl_kind with
 						let type_kind,path = match c.cl_kind with
 							| KAbstractImpl a -> "abstract",a.a_path
 							| KAbstractImpl a -> "abstract",a.a_path