Skip to content

Commit

Permalink
Limit CTFE assert message backtick fix to < 2.106
Browse files Browse the repository at this point in the history
  • Loading branch information
zorael committed Dec 16, 2023
1 parent 540efa2 commit 34f60d0
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions source/kameloso/plugins/common/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -2373,15 +2373,21 @@ void udaSanityCheckCTFE(const IRCEventHandler uda)

assert(__ctfe, "udaSanityCheckCTFE called outside CTFE");

/++
There's something wrong with how the assert message is printed from CTFE.
Work around it somewhat by prepending a backtick.
https://issues.dlang.org/show_bug.cgi?id=24036
static if (__VERSION__ < 2106L)
{
/++
There's something wrong with how the assert message is printed from CTFE.
Work around it somewhat by prepending a backtick.
Add a `static if` on the compiler version when this is fixed.
+/
enum fix = "`";
https://issues.dlang.org/show_bug.cgi?id=24036
+/
enum fix = "`";
}
else
{
// Fixed in 2.106.
enum fix = string.init;
}

if (!uda.acceptedEventTypes.length)
{
Expand Down Expand Up @@ -2530,7 +2536,7 @@ auto assertSaneStorageClasses(

assert(__ctfe, "`assertSaneStorageClasses` called outside CTFE");

static if (__VERSION__ <= 2104L)
static if (__VERSION__ < 2106L)
{
/++
There's something wrong with how the assert message is printed from CTFE.
Expand All @@ -2542,7 +2548,7 @@ auto assertSaneStorageClasses(
}
else
{
// Hopefully no need past 2.104... Update when 2.105 is out.
// Fixed in 2.106.
enum fix = string.init;
}

Expand Down

0 comments on commit 34f60d0

Please sign in to comment.