A cast is guaranteed correct here, by the definition of "dchar can hold any character natively". It cannot "slice" the char. You could even consider just calling `assert(indexOf(to!S("ödef"), 'ö', CaseSensitive.no) == 0);` which would cover the `wchar` branch.

In any case, calling a `to` means pulling out the runtime conversions, which is completely unnecessary.