Procházet zdrojové kódy

Revert "[filters] turn "on static platforms, null can't be used as basic type" error into a warning"

This reverts commit 7dd574578fca0026601758b5b580481bbaa229bc.
Rudy Ges před 5 dny
rodič
revize
83a7f23982
2 změnil soubory, kde provedl 1 přidání a 7 odebrání
  1. 0 5
      src-json/warning.json
  2. 1 2
      src/filters/safe/sanitize.ml

+ 0 - 5
src-json/warning.json

@@ -89,11 +89,6 @@
 		"doc": "The compiler could not determine a type order due to mutually dependent static initializations",
 		"parent": "WTyper"
 	},
-	{
-		"name": "WStaticPlatformBasicTypeNull",
-		"doc": "Warns when the compiler replaces `null` with the default value for a basic type on static platforms.",
-		"parent": "WTyper"
-	},
 	{
 		"name": "WClosureCompare",
 		"doc": "Closures are being compared, which might be undefined",

+ 1 - 2
src/filters/safe/sanitize.ml

@@ -80,8 +80,7 @@ let sanitize_expr scom e =
 				| TAbstract(a,tl) when not (Meta.has Meta.CoreType a.a_meta) -> loop (apply_params a.a_params tl a.a_this)
 				| _ when scom.platform == Cross -> e
 				| _ ->
-					SafeCom.add_warning scom WStaticPlatformBasicTypeNull (Printf.sprintf "On static platforms, `null` can't be used as basic type `%s`; using platform default value instead" (s_type (print_context()) e.etype)) e.epos;
-					{ e with eexpr = TCast (e, Some (module_type_of_type t)) }
+					Error.raise_typing_error ("On static platforms, null can't be used as basic type " ^ s_type (print_context()) e.etype) e.epos
 			in
 			loop e.etype
 		end else e