From 683fbc7652376924565b50d232a8931210d4800c Mon Sep 17 00:00:00 2001 From: Geod24 Date: Tue, 28 Feb 2023 11:33:57 +0100 Subject: [PATCH] Change how preview=in is detected This is a minor internal change, but will allow us to deprecate in ref at the parser level. --- std/format/internal/write.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/std/format/internal/write.d b/std/format/internal/write.d index 3a6842b3cd6..7f127c09847 100644 --- a/std/format/internal/write.d +++ b/std/format/internal/write.d @@ -1829,7 +1829,8 @@ enum HasToStringResult customPutWriterFormatSpec, } -private enum hasPreviewIn = !is(typeof(mixin(q{(in ref int a) => a}))); +private alias DScannerBug895 = int[256]; +private immutable bool hasPreviewIn = ((in DScannerBug895 a) { return __traits(isRef, a); })(DScannerBug895.init); template hasToString(T, Char) {