fix Issue 10078 - std.string.indexOf fails at compile time

supersedes #1293