You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
[error] Invalid override. The type of HexDecoder.startChunkedConversion ((Sink<List<int>>) → StringConversionSink) is not a subtype of Converter<String, List<int>>.startChunkedConversion ((Sink<dynamic>) → ChunkedConversionSink<dynamic>). (/Users/kevmoo/source/github/convert/lib/src/hex/decoder.dart, line 34, col 3)
[error] Invalid override. The type of HexEncoder.startChunkedConversion ((Sink<String>) → ByteConversionSink) is not a subtype of Converter<List<int>, String>.startChunkedConversion ((Sink<dynamic>) → ChunkedConversionSink<dynamic>). (/Users/kevmoo/source/github/convert/lib/src/hex/encoder.dart, line 24, col 3)
[error] Invalid override. The type of PercentDecoder.startChunkedConversion ((Sink<List<int>>) → StringConversionSink) is not a subtype of Converter<String, List<int>>.startChunkedConversion ((Sink<dynamic>) → ChunkedConversionSink<dynamic>). (/Users/kevmoo/source/github/convert/lib/src/percent/decoder.dart, line 44, col 3)
[error] Invalid override. The type of PercentEncoder.startChunkedConversion ((Sink<String>) → ByteConversionSink) is not a subtype of Converter<List<int>, String>.startChunkedConversion ((Sink<dynamic>) → ChunkedConversionSink<dynamic>). (/Users/kevmoo/source/github/convert/lib/src/percent/encoder.dart, line 27, col 3)
The text was updated successfully, but these errors were encountered:
I think this is right, at least given our current co-variant generics. We should be producing better error messages, but the first error message is basically telling you that (Sink<List<int>>) → StringConversionSink is not a subtype of (Sink<dynamic>) → ChunkedConversionSink<dynamic>, which is true (since if you pass a function expectsASinkOfListOfInt which expects to be called with a Sink<List<int>> to a context expecting something which can be called with any Sink<dynamic>, then expectsASinkOfListOfInt might get called with a Sink<String>, and hijinks might ensue.
If Sink is in fact contra-variant in its type parameter, then this could be reasonable - is it? I've been wondering whether we should add annotation based support for type parameter variance at some point - would that be the right resolution for this?
From: https://github.com/dart-lang/convert
with
dartanalyzer --strong lib/convert.dart
The text was updated successfully, but these errors were encountered: