Browse Source

do not try fancy inference if we have explicit type parameters in ENew (see #4273)

Simon Krajewski 10 years ago
parent
commit
55b4487275
1 changed files with 3 additions and 1 deletions
  1. 3 1
      typer.ml

+ 3 - 1
typer.ml

@@ -3351,7 +3351,9 @@ and type_expr ctx (e,p) (with_type:with_type) =
 			| _ ->
 				error "Constructor is not a function" p
 		in
-		let t = try
+		let t = if t.tparams <> [] then
+			follow (Typeload.load_instance ctx t p false)
+		else try
 			ctx.call_argument_stack <- el :: ctx.call_argument_stack;
 			let t = follow (Typeload.load_instance ctx t p true) in
 			ctx.call_argument_stack <- List.tl ctx.call_argument_stack;