-
Notifications
You must be signed in to change notification settings - Fork 28
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
A few tests related to type aliases should be updated #1029
Comments
Issue 42435 describes exactly the case from * Is is marked as area-front-end and its evaluation reads that there should be a compile error there. So which behavior is really correct? |
About Reading the error specification again, the error does actually apply for formal type parameters declared by any kind of entity (in particular, it applies for formal type parameters of a function declaration and of a function type). So there is no need to change the specification after all. The test currently expects a compile-time error, which is correct, but it is somewhat misleading when it says that (So |
I found one more test that needs correction: The line to be corrected is line 60: F<A<C<dynamic>?>> target = fsource; As I understood from our conversation with @eernstg it should be marked as a compile-time error in the testcase. |
Just to make sure we can track down reasons & mistakes 😄 here's the reasoning: A<C<dynamic>?> // is not well-bounded, because
C<dynamic>? <: C<C<dynamic>?> // does not hold, so it's not regular-bounded, and
C<Never>? <: C<C<Never>?> // does not hold, so it's not super-bounded. But maybe the intention was to declare the following, because i2b of F<A<C<dynamic>>> target = fsource; |
…t06/02 corrected and does not expect a compile error now.
Indeed, dart and analyzer claims to the same line, but to the different positions. |
Running the test locally, I get the impression that it's just a missing |
Yes, for unspecified errors the location is ignored. So is there an issue with the test, or is this an implementation issue? |
Now the test contains class A<X extends A<X>> {}
typedef B<X extends A<A<X>>> = A<X>;
// ^
// [analyzer] unspecified
// [cfe] unspecified
main() {
} If it's so, then:
So can I close this bug as fixed? |
As I mentioned,
I interpret that to mean that the test must be fixed by adding that line. |
@eernstg No, I don't think that should be necessary - it does fix it, but I believe only by papering over the problem. I believe the problem here is that there are three different locations specified on one line in that test, which I don't think is supported?
@munificent might be able to comment. If I change this test to: class A<X extends A<X>> {}
typedef B<X extends A<A<X>>> = A<X>;
// ^
// [analyzer] unspecified
// [cfe] unspecified it passes on the CFE. Note that this test is not being run on the analyzer, because it is explicitly skipped. |
Filed dart-lang/sdk#45481 to try to sort out why this and other tests are skipped on the analyzer. |
Such a change's already checked in at 2 days ago |
Dart passes with the line 60 whereas analyzer throws a compile time error. So which behavior is correct here? To not to lose this problem I've just filed an issue #45487. |
The test co19/LanguageFeatures/Instantiate-to-bound/nonfunction_typedef/static/nonfunction_l1_t08 will be fixed in the issue #1049, so I am closing #1029 now. |
@leafpetersen wrote:
Of course! I thought the test runner had to have some special magic requiring |
I think the following three tests should be updated:
co19/Language/Generics/Superbounded_types/typedef3_A01_t06/02
B<A<A<A<B<A<dynamic>>>>>>
is super-bounded, so the line containing it shouldn't be marked as expecting a compile-time error.co19/LanguageFeatures/Instantiate-to-bound/nonfunction_typedef/static/nonfunction_l1_t04
Seems that the errors are expected; although, the location of one of the three errors is different for Analyzer and the CFE because the CFE can't point inside of types yet. I guess the test should be updated adjusting the locations of the errors.
co19/Language/Generics/typedef_A06_t04
The right-hand side of the typedef there is a regular-bounded type (it's not even an application of a generic type to type arguments), and all parts of it are well-bounded.
The text was updated successfully, but these errors were encountered: