浏览代码

[typer] more helpful error for invalid usage of @:const type params (#6953)

* [typer] more helpful error for invalid usage of @:const type params

* [skip ci]

* [skip ci]
Jens Fischer 7 年之前
父节点
当前提交
5cd425d8e3
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/typing/typer.ml

+ 1 - 1
src/typing/typer.ml

@@ -2320,7 +2320,7 @@ and type_ident ctx i p mode =
 				if Typeload.is_generic_parameter ctx c && Meta.has Meta.Const c.cl_meta then
 					AKExpr (type_module_type ctx (TClassDecl c) None p)
 				else begin
-					display_error ctx ("Type parameter " ^ i ^ " is only available at compilation and is not a runtime value") p;
+					display_error ctx ("Only @:const type parameters on @:generic classes can be used as value") p;
 					AKExpr (mk (TConst TNull) t_dynamic p)
 				end
 			with Not_found ->