-
Notifications
You must be signed in to change notification settings - Fork 1.7k
SDK now refuses to compile code with invalid annotations. Breaks code that uses unittest. #25204
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
Comments
Right now, this would break many applications. For example, if we updated the SDK it would break every html test and various package tests. It would be easy to fix unittest, but we would still break things until people did a pub upgrade. I think it would be better if we made this a warning in the compiler where it would complain, but not refuse to compile. |
Section 15 of the spec does indicate that it should be a compile-time error though. @gbracha can we change it to be just a warning in this case? The alternative I see is for us to make it a warning in Dart 1.14, update all the packages, and make it an error in Dart 1.15 |
(just to clarify - the CL above was fixing #14548 - a very old dart2js bug regarding that spec section) |
Let's not change the spec. This is totally valid. But waiting at least until 1.15 to crash in dart2js is a good idea, IMHO |
Also, take this as a good time to switch to |
Dart2js doesn't crash; it reports a compile-time error. On 10 December 2015 at 02:30, Kevin Moore [email protected] wrote:
|
@johnniwinther - I think @kevmoo meant "crash" as "produce an error without any output". @floitschG gave a couple additional suggestions:
I'm fine with either - @johnniwinther which of these would be easier? Seems like the latter might fit more nicely with our current architecture. |
Folks are going to be annoyed enough w/ new error messages. NO FLAGS for this. The result should NOT CHANGE from before. Yell at the user: fine. 😃 |
Where is this annotation? I can't find it in the 0.11.x branch or indeed anywhere in the history of the repo. |
https://github.com/dart-lang/old_unittest/blob/master/lib/unittest.dart On Thu, Dec 10, 2015 at 3:15 PM Natalie Weizenbaum [email protected]
|
I see. That repo tracks the 0.12.x releases of the |
@alan-knight which version of unittest are you seeing the issue with? |
I saw this because I have a package that I just test various small things unittest: On Thu, Dec 10, 2015 at 3:56 PM Kevin Moore [email protected]
|
@sigmundch We already have --generate-code-with-compile-time-errors option. Is that sufficient? |
@johnniwinther Please don't require a new flag to compile code that has compiled fine for a year. Let's go w/ a warning. |
keeping it as a warning for now sounds good. If we want to really be spec compliant, we could report it as an error, but continue compiling for this specific error only. That would require that we divide errors in 2 groups (fatal and non-fatal). Feels odd because all errors except this one would be fatal, but we could use it as a way of introducing errors in the future. Non-fatal errors will have a date/release when they will be come fatal (e.g. say that in 1.15 we'll flip the bit), so users have a transition path. |
@alan-knight I don't see how the
gives the following result on e03c395 (the previous commit): temp/test4.dart:2:2: Error: Compilation failed. Do you have an example of a program with this annotation that worked before but not after? |
Yes, I see that as well. So it must have been a pub upgrade giving me the version with the invalid annotation that caused it, rather than the compiler change. |
@alan-knight – @nex3 did fix |
As of https://codereview.chromium.org/1510863004 dart2js does not compile code that includes an invalid annotation. package:unittest/unittest.dart has an invalid annotation (@deprecated(...)), so things that still uses unittest refuse to compile. This is a badly breaking change, and the only reason the bots are still working is that the SDK has an old version of unittest without that annotation.
@kevmoo @johnniwinther
The text was updated successfully, but these errors were encountered: