Browse Source

check presence of `@:impl` for all abstract instance field access

Simon Krajewski 10 years ago
parent
commit
6586901d5f
1 changed files with 2 additions and 0 deletions
  1. 2 0
      typer.ml

+ 2 - 0
typer.ml

@@ -1555,6 +1555,8 @@ and type_field ?(resume=false) ctx e i p mode =
 			let f = PMap.find i c.cl_statics in
 			let f = PMap.find i c.cl_statics in
 			if not (can_access ctx c f true) && not ctx.untyped then display_error ctx ("Cannot access private field " ^ i) p;
 			if not (can_access ctx c f true) && not ctx.untyped then display_error ctx ("Cannot access private field " ^ i) p;
 			let field_type f =
 			let field_type f =
+				if not (Meta.has Meta.Impl f.cf_meta) then
+					error ("Invalid call to static function " ^ i ^ " through abstract instance") p;
 				let t = field_type ctx c [] f p in
 				let t = field_type ctx c [] f p in
 				apply_params a.a_params pl t
 				apply_params a.a_params pl t
 			in
 			in