From b8663f9fbc5b9355efd6b1df7d006b615b4797e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 1 Feb 2017 11:05:53 +0100 Subject: [PATCH] Conditionally compile TaskFiber.state. See https://issues.dlang.org/show_bug.cgi?id=17131 --- source/vibe/core/task.d | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/vibe/core/task.d b/source/vibe/core/task.d index b7ab8b8..b1b872d 100644 --- a/source/vibe/core/task.d +++ b/source/vibe/core/task.d @@ -322,11 +322,9 @@ final package class TaskFiber : Fiber { return ms_globalDummyFiber; } - @property State state() - @trusted const nothrow { - return super.state; - } - + // expose Fiber.state as @safe on older DMD versions + static if (!__traits(compiles, () @safe { return Fiber.init.state; } ())) + @property State state() @trusted const nothrow { return super.state; } private void run() {