Browse Source

give error on macro property accessor (fixed issue #1444)

Simon Krajewski 12 years ago
parent
commit
943390b60e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      typeload.ml

+ 5 - 0
typeload.ml

@@ -1426,6 +1426,11 @@ let init_class ctx c p context_init herits fields =
 				if ctx.com.display then () else
 				try
 					let _, t2, f = (if stat then let f = PMap.find m c.cl_statics in Some c, f.cf_type, f else class_field c m) in
+					(match f.cf_kind with
+						| Method MethMacro ->
+							display_error ctx "Macro methods cannot be used as property accessor" p;
+							display_error ctx "Accessor method is here" f.cf_pos;
+						| _ -> ());
 					unify_raise ctx t2 t f.cf_pos;
 					(match req_name with None -> () | Some n -> display_error ctx ("Please use " ^ n ^ " to name your property access method") f.cf_pos);
 				with