فهرست منبع

fixed bug with constraint parameter + polymorphic method.

Nicolas Cannasse 19 سال پیش
والد
کامیت
e7359639df
2فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 1 0
      doc/CHANGES.txt
  2. 6 1
      type.ml

+ 1 - 0
doc/CHANGES.txt

@@ -9,6 +9,7 @@
 	fixed bug in type_field with inherited type parameters
 	added haxe.Proxy
 	added code transformations for swf/js block variables
+	fixed very tricky bug with constraint parameters used together with polymorphic methods
 	
 2006-06-08: 1.02
 	fixed stack overflow when recursive class <: recursive signature

+ 6 - 1
type.ml

@@ -311,7 +311,12 @@ let apply_params cparams params t =
 		| TAnon fl ->
 			TAnon (PMap.map (fun f -> { f with cf_type = loop f.cf_type }) fl)
 		| TLazy f ->
-			loop (!f())
+			let ft = !f() in
+			let ft2 = loop ft in
+			if ft == ft2 then
+				t
+			else
+				ft2
 		| TDynamic t2 ->
 			if t == t2 then
 				t