Ver código fonte

allow @:arrayAccess functions to not have an expression

Simon Krajewski 11 anos atrás
pai
commit
c4883627b3
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      typeload.ml

+ 4 - 0
typeload.ml

@@ -1760,6 +1760,10 @@ let init_class ctx c p context_init herits fields =
 						| (Meta.ArrayAccess,_,_) :: _ ->
 						| (Meta.ArrayAccess,_,_) :: _ ->
 							if is_macro then error "Macro array-access functions are not supported" p;
 							if is_macro then error "Macro array-access functions are not supported" p;
 							a.a_array <- cf :: a.a_array;
 							a.a_array <- cf :: a.a_array;
+							if fd.f_expr = None then begin
+								if inline then error ("Inline array access functions must have an expression") f.cff_pos;
+								do_bind := false
+							end;
 						| (Meta.Op,[EBinop(op,_,_),_],_) :: _ ->
 						| (Meta.Op,[EBinop(op,_,_),_],_) :: _ ->
 							if is_macro then error "Macro operator functions are not supported" p;
 							if is_macro then error "Macro operator functions are not supported" p;
 							let targ = if Meta.has Meta.Impl f.cff_meta then tthis else ta in
 							let targ = if Meta.has Meta.Impl f.cff_meta then tthis else ta in