Skip to content

Commit

Permalink
also report field position on @:isVar errors for transition convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Oct 31, 2012
1 parent 51ea93d commit f5094ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion typer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,10 @@ let field_access ctx mode f t e p =
| AccCall m ->
if m = ctx.curfield.cf_name && (match e.eexpr with TConst TThis -> true | TTypeExpr (TClassDecl c) when c == ctx.curclass -> true | _ -> false) then
let prefix = (match ctx.com.platform with Flash when Common.defined ctx.com Define.As3 -> "$" | _ -> "") in
if is_extern_field f then display_error ctx "This field cannot be accessed since it is not an actual var, add @:isVar to enable it" p;
if is_extern_field f then begin
display_error ctx "This field cannot be accessed since it is not an actual var" p;
display_error ctx "Add @:isVar here to enable it" f.cf_pos;
end;
AKExpr (mk (TField (e,prefix ^ f.cf_name)) t p)
else if mode = MSet then
AKSet (e,m,t,f.cf_name)
Expand Down

0 comments on commit f5094ec

Please sign in to comment.