-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn on and fix mixin type inference checks when not in "supermixin" …
…mode. Now that we have an explicit syntax for mixins that is available all the time, we have to do mixin inference error checking all the time, not just when the "--supermixin" flag is supplied. This required fixing several minor bugs: - ErrorVerifier._checkForMixinSuperInvokedMembers did not properly handle a mixinElement argument that was a ClassElementHandle. - ErrorVerifier._checkMixinInference wasn't using the actual substituted mixin types, causing errors to be wrongly reported when a class declaration had multiple inferred mixins (this was the root cause of #34404). - Type names in "with" clauses in the resolved AST weren't properly reflecting the mixin type arguments that had been inferred. Fixes #34404. Change-Id: Ia773233c66f8d9ab778f207689c73922e9e3a880 Reviewed-on: https://dart-review.googlesource.com/75792 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
- Loading branch information
1 parent
b7f7629
commit 46e5954
Showing
9 changed files
with
164 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2018, 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. | ||
|
||
// This test case is a reduction of some Flutter code, modified to use the new | ||
// mixin syntax. We wish to verify that the class _DismissibleState doesn't | ||
// have any type inference errors. | ||
|
||
class _DismissibleState extends State<Dismissible> | ||
with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {} | ||
|
||
abstract class State<T extends StatefulWidget> extends Diagnosticable {} | ||
|
||
abstract class StatefulWidget extends Widget {} | ||
|
||
abstract class Widget extends DiagnosticableTree {} | ||
|
||
abstract class DiagnosticableTree extends Diagnosticable {} | ||
|
||
abstract class Diagnosticable {} | ||
|
||
class Dismissible extends StatefulWidget {} | ||
|
||
mixin TickerProviderStateMixin<T extends StatefulWidget> on State<T> | ||
implements TickerProvider {} | ||
|
||
abstract class TickerProvider {} | ||
|
||
mixin AutomaticKeepAliveClientMixin<T extends StatefulWidget> on State<T> {} | ||
|
||
main() { | ||
new _DismissibleState(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2018, 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. | ||
// SharedOptions=--supermixin | ||
|
||
// This test case is a reduction of some Flutter code. We wish to verify that | ||
// the class _DismissibleState doesn't have any type inference errors. | ||
|
||
class _DismissibleState extends State<Dismissible> | ||
with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {} | ||
|
||
abstract class State<T extends StatefulWidget> extends Diagnosticable {} | ||
|
||
abstract class StatefulWidget extends Widget {} | ||
|
||
abstract class Widget extends DiagnosticableTree {} | ||
|
||
abstract class DiagnosticableTree extends Diagnosticable {} | ||
|
||
abstract class Diagnosticable {} | ||
|
||
class Dismissible extends StatefulWidget {} | ||
|
||
abstract class TickerProviderStateMixin<T extends StatefulWidget> | ||
extends State<T> implements TickerProvider {} | ||
|
||
abstract class TickerProvider {} | ||
|
||
abstract class AutomaticKeepAliveClientMixin<T extends StatefulWidget> | ||
extends State<T> {} | ||
|
||
main() { | ||
new _DismissibleState(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters