Browse Source

fixed stack overflow with static setter

Nicolas Cannasse 18 years ago
parent
commit
88457c9cb1
2 changed files with 2 additions and 1 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      typer.ml

+ 1 - 0
doc/CHANGES.txt

@@ -20,6 +20,7 @@
 	fixed Flash9 dynamic runtime type field access
 	fixed very tricky typing bug with constructors inheritance
 	fixed some documentation related parser bug
+	fixed stack overflow with static setter
 
 2007-07-25: 1.14
 	fixed no error when invalid "catch" expression

+ 1 - 1
typer.ml

@@ -256,7 +256,7 @@ let field_access ctx get f t e p =
 	| NormalAccess | F9MethodAccess ->
 		AccExpr (mk (TField (e,f.cf_name)) t p)
 	| MethodAccess m ->
-		if m = ctx.curmethod && e.eexpr = TConst TThis then
+		if m = ctx.curmethod && (match e.eexpr with TConst TThis -> true | TTypeExpr (TClassDecl c) when c == ctx.curclass -> true | _ -> false) then
 			AccExpr (mk (TField (e,f.cf_name)) t p)
 		else if get then
 			AccExpr (mk (TCall (mk (TField (e,m)) (mk_mono()) p,[])) t p)