mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 20:51:50 +00:00
96a346fc5e
Previously this step happened during `buildOutlineNodes`, but since `buildOutlineNodes` happens in source order, this means that anonymous mixins would only get their sealed and final attributes properly inferred if they appeared *after* their immediate supertypes in source order. By moving this step to `checkSupertypes`, we ensure that the computation is correct regardless of source order, because `checkSupertypes` happens in class hierarchy order. Fixes #52048. Bug: https://github.com/dart-lang/sdk/issues/52048 Change-Id: Ib9f1f3dafded88681a26f09e4d21dfd44e70dfd3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297901 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
23 lines
376 B
Dart
23 lines
376 B
Dart
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
main() {
|
|
f(B());
|
|
}
|
|
|
|
f(A a) {
|
|
switch (a) {
|
|
case B():
|
|
print("It's a B");
|
|
}
|
|
}
|
|
|
|
class B extends A with M {
|
|
B();
|
|
}
|
|
|
|
sealed class A {}
|
|
|
|
mixin M {}
|