[Issue 23637] [betterC] DMD issues GC usage error during CTFE
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Jan 18 14:03:07 UTC 2023
    
    
  
https://issues.dlang.org/show_bug.cgi?id=23637
RazvanN <razvan.nitu1305 at gmail.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305 at gmail.com
         Resolution|---                         |INVALID
--- Comment #2 from RazvanN <razvan.nitu1305 at gmail.com> ---
This is not a bug.
You are compiling with -betterC so code needs to be generated for `myToString`.
That code ends up in the object file and may be linked at some point, therefore
the compiler tells you that you are compiling with -betterC which means that
you cannot use functions from druntime (the array concat hook).
If you template the myToString method then the code compiles successfully
because the template instances do not make it to the object file.
--
    
    
More information about the Digitalmars-d-bugs
mailing list