Переглянути джерело

call abstract toString only if it actually exists

Simon Krajewski 12 роки тому
батько
коміт
06d9e0530f
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -3132,7 +3132,7 @@ and type_expr ctx (e,p) (with_type:with_type) =
 		let e = match m with
 			| (Meta.ToString,_,_) ->
 				(match follow e.etype with
-					| TAbstract({a_impl = Some c},_) -> call_to_string ctx c e
+					| TAbstract({a_impl = Some c},_) when PMap.mem "toString" c.cl_statics -> call_to_string ctx c e
 					| _ -> e)
 			| _ -> e
 		in