From 3f8ee3e04925fb3935ebb125c795bb0b58c461cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 7 Feb 2024 08:30:02 +0100 Subject: [PATCH] Fix compile error on old compiler versions. --- examples/rest-collections/source/app.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/rest-collections/source/app.d b/examples/rest-collections/source/app.d index d687523fec..53d2a3e979 100644 --- a/examples/rest-collections/source/app.d +++ b/examples/rest-collections/source/app.d @@ -48,7 +48,10 @@ class LocalThreadAPI : ThreadAPI { string[] get() { - return m_data.threads.keys; + static if (__VERSION__ < 2099) { + // NOTE: .keys is not @safe on older compiler versions + return () @trusted { return m_data.threads.keys; } (); + } else return m_data.threads.keys; } }