Browse Source

ArrayAccess bugfixes
minor fixes in flash10 api

Nicolas Cannasse 17 years ago
parent
commit
bddd4d2bc5
5 changed files with 17 additions and 17 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      std/flash9/events/Event.hx
  3. 0 6
      std/flash9/events/SamplesCallbackEvent.hx
  4. 0 1
      std/haxe/ImportAll.hx
  5. 15 9
      typer.ml

+ 1 - 0
doc/CHANGES.txt

@@ -8,6 +8,7 @@
 	added memory related functions to php.Sys
 	added error when trying to extend Array, String, Date and Xml
 	fixed handling of implements ArrayAccess
+	fixed some minor things in flash10 api
 
 2008-10-04: 2.01
 	fixed php.Sys

+ 1 - 1
std/flash9/events/Event.hx

@@ -50,7 +50,7 @@ extern class Event {
 
 	#if flash10
 	static var FRAME_CONSTRUCTED : String;
-	static var SAMPLES_CALLBACK : String;
+	static var SAMPLES_DATA : String;
 	static var EXIT_FRAME : String;
 	static var CUT : String;
 	static var COPY : String;

+ 0 - 6
std/flash9/events/SamplesCallbackEvent.hx

@@ -1,6 +0,0 @@
-package flash.events;
-
-extern class SamplesCallbackEvent extends Event {
-	var position : Float;
-	function new( ?type : String, ?bubbles : Bool, ?cancelable : Bool, ?position : Float ) : Void;
-}

+ 0 - 1
std/haxe/ImportAll.hx

@@ -458,7 +458,6 @@ import tools.hxinst.Main;
 import flash.Vector;
 
 import flash.events.SampleDataEvent;
-import flash.events.SamplesCallbackEvent;
 import flash.events.ShaderEvent;
 
 import flash.display.GraphicsBitmapFill;

+ 15 - 9
typer.ml

@@ -965,15 +965,21 @@ and type_access ctx e p get =
 		let e1 = type_expr ctx e1 in
 		let e2 = type_expr ctx e2 in
 		unify ctx e2.etype ctx.api.tint e2.epos;
-		let pt = (match follow e1.etype with
-		| TInst ({ cl_array_access = Some t; cl_types = pl },tl) ->
-			apply_params pl tl t
-		| _ -> 
-			let pt = mk_mono() in
-			let t = ctx.api.tarray pt in
-			unify ctx e1.etype t e1.epos;
-			pt
-		) in
+		let rec loop et =
+			match follow et with
+			| TInst ({ cl_array_access = Some t; cl_types = pl },tl) ->
+				apply_params pl tl t
+			| TInst ({ cl_super = Some (c,stl); cl_types = pl },tl) ->
+				apply_params pl tl (loop (TInst (c,stl)))
+			| TInst ({ cl_path = [],"ArrayAccess" },[t]) ->
+				t
+			| _ -> 
+				let pt = mk_mono() in
+				let t = ctx.api.tarray pt in
+				unify ctx e1.etype t e1.epos;
+				pt
+		in
+		let pt = loop e1.etype in
 		AccExpr (mk (TArray (e1,e2)) pt p)
 	| _ ->
 		AccExpr (type_expr ctx (e,p))