I removed the cast. Note, I inlined the StringSource impl from analyzer:src/string_source.dart because, when used for resolution, the analyzer complained that StringSource did not implement the `encoding` method. If the analyzer impl implements that, I'll remove this inlined version.