From a11d3bcdb544b5d8d0341d549f944dce9f5319e0 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Wed, 23 May 2018 11:47:02 +0100 Subject: [PATCH] Don't allocate argument mismatch string when errors gagged --- src/dmd/mtype.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dmd/mtype.d b/src/dmd/mtype.d index f5c51902ce9a..31a5498cf9c1 100644 --- a/src/dmd/mtype.d +++ b/src/dmd/mtype.d @@ -4782,6 +4782,8 @@ extern (C++) final class TypeFunction : TypeNext // arguments get specially formatted private const(char)* getParamError(const(char)* format, Expression arg, Parameter par) { + if (global.gag && !global.params.showGaggedErrors) + return null; // show qualification when toChars() is the same but types are different auto at = arg.type.toChars(); bool qual = !arg.type.equals(par.type) && strcmp(at, par.type.toChars()) == 0;