-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LineSplitter not assignable to Converter<String, List<String>> #28748
Comments
What version are you seeing this in? There was a temporary regression in the analyzer configuration logic that broke this, see here: #28507 . This is fixed in bleeding edge, and I believe in more recent 1.22 dev releases. Closing the issues, but if you're seeing this in the latest dev release (or the next release candidate) please re-open. |
This was in 1.22.0-dev.9.1 |
Yes, it was broken in that dev release, fixed as of (at least) dev.10.1. |
Actually I'm still seeing this in 1.22.0-dev.10.6 -- see the failures in dart-archive/file.dart#38 |
Still seeing this in 1.22.0-dev.10.6 (along with an inexplicable abundance of I don't seem to have permission to re-open the issue; @leafpetersen, can you? |
I can reproduce. This was fixed from (at least) dev.10.1 through dev.10.3, but I see a regression again in dev.10.4 . As a workaround, you can use dev.10.3 for now. |
Sorry, I didn't look through your original example closely enough. This is correct behavior. Linesplitter is not really type safe as originally written. To make it strong mode clean, the comment syntax was used to change its base class in strong mode. class LineSplitter
extends Converter<String, List<String>>/*=Object*/
implements ChunkedConverter<String, List<String>, String, String>
/*=StreamTransformer<String, String>*/ { In strong mode, this is treated as extending So the error is correct, the regression was the temporary set of dev releases that used the old signature in strong mode. |
@leafpetersen so is this code block even safe?
|
@lrhn @floitschG Should really look at this. Now that we've shipped generic syntax, this really should be cleaned up. |
I guess a meta-question is: can we make |
Not really. The Semantically speaking, I think |
What @nex3 said. @lrhn @floitschG Reasonable? |
Yes. I don't think we should remove the I would suggest closing this bug. We already have plans to completely remove the comment syntax which would make the transition from |
@floitschG but that will be a breaking change, right? For which milestone? |
When migrating to strong mode, programs need to adapt (but they need to do that anyway). After that there is no breaking change. |
So it sounds like the resolution to this bug is changing LineSplitter's signature from: class LineSplitter extends Converter<String, List<String>> /*=Object*/
implements
ChunkedConverter<String, List<String>, String, String>
/*=StreamTransformer<String, String>*/ { to class LineSplitter implements StreamTransformer<String, String> { This is strange enough that I think it warrants its own bug (this bug, which blocks #28796 and #28773 rather than is a duplicate of), and warrants its own line in the CHANGELOG. |
Removing the comment syntax is a breaking change, which is why we were expecting to not do it until Dart 2.0. Until then, strong mode uses the Dart 2 signature and Dart 1 programs use the original one. It is annoying to maintain the comment syntax, and it would be great to not need it any more. |
Are we saying this won't be in |
Removed the milestone. There is no reason to force this change. It will naturally happen once we discontinue support for comment syntax. |
Making the change is a breaking change for the `LineSplitter` since the new declaration, expressed using comments, isn't backwards compatible with the existing class declaration.
|
Comment syntax was clearly communicated as experimental and |
The problem here is that we don't just want to remove the comments, which would only be affecting the experimental version, but actually change the existing declaration to be the one that is currently in comments. |
I see. Thanks for clarification. |
I don't think this was actually supposed to be closed by dart-archive/file.dart#62. |
@nex3 I had actually intended to close this off, but am happy to keep it open if there's something actionable we still intend to do? As of now though, the use of the comment syntax in line_splitter.dart has been remove, LineSplitter works as you describe here: #28748 (comment) , and the original example from this issue is fixed. |
Oh okay, I just assumed that the "fixes" line in the file.dart commit accidentally closed this issue. It sounds like it was intentional, though, and I don't have anything else I think needs to be done. |
That line yields the following analyzer error:
And yet,
LineSplitter extends Converter<String, List<String>>
Huh??
The text was updated successfully, but these errors were encountered: