[Issue 22865] __traits(compiles) affects inferrence of attributes
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Mar 9 20:06:35 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22865
Basile-z <b2.temp at gmx.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |safe
CC| |b2.temp at gmx.com
--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
patch
---
diff --git a/src/dmd/expressionsem.d b/src/dmd/expressionsem.d
index 6eda68880..0c060fd0d 100644
--- a/src/dmd/expressionsem.d
+++ b/src/dmd/expressionsem.d
@@ -7629,6 +7629,8 @@ private extern (C++) final class
ExpressionSemanticVisitor : Visitor
// Check for unsafe casts
if (!sc.intypeof &&
+ !(sc.flags & SCOPE.compile && sc.flags & SCOPE.ctfe) &&
!(sc.flags & SCOPE.debug_) &&
!isSafeCast(ex, t1b, tob) &&
(!sc.func && sc.stc & STC.safe || sc.func && sc.func.setUnsafe()))
---
--
More information about the Digitalmars-d-bugs
mailing list