Comment #0 by pro.mathias.lang — 2015-03-28T20:23:01Z
Currently, the following code will fail to compile:
````
void main() {
import std.datetime, std.traits;
interface IKeysAPI {
string create(SysTime expiry = 0);
}
alias ParamDefaults = ParameterDefaultValueTuple!(IKeysAPI.create);
}
````
IIUC, when getting a value using `__parameters`, the value is expected to be of the type of the argument, and thus is converted as soon as anyone tries to read it.
I marked it as a DMD bug because I believe it should not try to do the convertion, but rather expose more informations than just a typetuple and let the library's contributor decide.
Ultimately, what I'll be aiming for is something like a struct with:
- 'Type' => alias to the type of the parameter.
- 'identifier' => Well you get it.
- 'value' => Default value of the parameter. Either a TypeTuple with one or 0 entry, or another brighter solution. This should take into account that default value can be C function calls (like `time_t currTime = time(null)`), which is why this field could be an alias.
Comment #1 by robert.schadek — 2024-12-13T18:41:43Z