How to preserve function parameters scopeness
Simen Kjærås
simen.kjaras at gmail.com
Thu Jun 6 11:15:09 UTC 2019
On Thursday, 6 June 2019 at 09:45:08 UTC, Ivan Butygin wrote:
> I want to extract function parameters types from declaration,
> remove some of them and construct new function pointer type
> from remaining types. Doing this in obvious way cause
> parameters to lost their scope storage class:
> https://run.dlang.io/is/cQBFRW
>
> I can extract and store scope information separately via
> ParameterStorageClassTuple but I don't know how to apply this
> information back when constructing new function pointer type.
> Of course I can CTFE string representation with full
> declaration and mixin it but it's ugly and probably slow to
> compile. Any ideas how to do this better?
>
> I need this for my jit-bind template machinery, if someone
> interested
> https://github.com/ldc-developers/ldc/blob/master/runtime/jit-rt/d/ldc/dynamic_compile.d#L120
As far as I know, this is currently impossible without CTFE and
mixins. FWIW, it's filed here:
https://issues.dlang.org/show_bug.cgi?id=19787
--
Simen
More information about the Digitalmars-d
mailing list