-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cfe] Use the supertype locations when reporting errors
Closes #45626. Bug: #45626 Change-Id: I672efb0bba516534151630e6627959e0971840e5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195515 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Erik Ernst <eernst@google.com>
- Loading branch information
Dmitry Stefantsov
authored and
commit-bot@chromium.org
committed
Apr 16, 2021
1 parent
d26ede6
commit 025bcc4
Showing
12 changed files
with
689 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,7 @@ class5b | |
class5c | ||
class5d | ||
cloneable | ||
cm | ||
cmd | ||
cmp | ||
cnn | ||
|
22 changes: 22 additions & 0 deletions
22
pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart
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,22 @@ | ||
// Copyright (c) 2021, 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. | ||
|
||
import 'issue45626.dart' as self; | ||
|
||
class C {} | ||
typedef CAlias = C; | ||
|
||
class D implements C, C {} | ||
class D2 implements C, CAlias {} | ||
class D3 implements CAlias, C {} | ||
class D4 implements C, self.C {} | ||
class D5 implements self.C, C {} | ||
|
||
mixin CM on C, C {} | ||
mixin CM2 on C, CAlias {} | ||
mixin CM3 on CAlias, C {} | ||
mixin CM4 on self.C, C {} | ||
mixin CM5 on C, self.C {} | ||
|
||
main() {} |
126 changes: 126 additions & 0 deletions
126
pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart.strong.expect
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,126 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:10:23: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D implements C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:11:24: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D2 implements C, CAlias {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:12:29: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D3 implements CAlias, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:13:24: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D4 implements C, self.C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:14:29: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D5 implements self.C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:16:16: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM on C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:17:17: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM2 on C, CAlias {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:18:22: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM3 on CAlias, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:19:22: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM4 on self.C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:20:17: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM5 on C, self.C {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
import "org-dartlang-testcase:///issue45626.dart" as self; | ||
|
||
typedef CAlias = self::C; | ||
class C extends core::Object { | ||
synthetic constructor •() → self::C | ||
: super core::Object::•() | ||
; | ||
} | ||
class D extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D | ||
: super core::Object::•() | ||
; | ||
} | ||
class D2 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D2 | ||
: super core::Object::•() | ||
; | ||
} | ||
class D3 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D3 | ||
: super core::Object::•() | ||
; | ||
} | ||
class D4 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D4 | ||
: super core::Object::•() | ||
; | ||
} | ||
class D5 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D5 | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class _CM&C&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM&C&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM extends self::_CM&C&C /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM2&C&CAlias extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM2&C&CAlias | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM2 extends self::_CM2&C&CAlias /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM3&CAlias&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM3&CAlias&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM3 extends self::_CM3&CAlias&C /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM4&C&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM4&C&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM4 extends self::_CM4&C&C /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM5&C&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM5&C&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM5 extends self::_CM5&C&C /*isMixinDeclaration*/ { | ||
} | ||
static method main() → dynamic {} |
126 changes: 126 additions & 0 deletions
126
pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart.strong.transformed.expect
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,126 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:10:23: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D implements C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:11:24: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D2 implements C, CAlias {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:12:29: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D3 implements CAlias, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:13:24: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D4 implements C, self.C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:14:29: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// class D5 implements self.C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:16:16: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM on C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:17:17: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM2 on C, CAlias {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:18:22: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM3 on CAlias, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:19:22: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM4 on self.C, C {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart:20:17: Error: 'C' can only be implemented once. | ||
// Try removing 1 of the occurrences. | ||
// mixin CM5 on C, self.C {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
import "org-dartlang-testcase:///issue45626.dart" as self; | ||
|
||
typedef CAlias = self::C; | ||
class C extends core::Object { | ||
synthetic constructor •() → self::C | ||
: super core::Object::•() | ||
; | ||
} | ||
class D extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D | ||
: super core::Object::•() | ||
; | ||
} | ||
class D2 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D2 | ||
: super core::Object::•() | ||
; | ||
} | ||
class D3 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D3 | ||
: super core::Object::•() | ||
; | ||
} | ||
class D4 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D4 | ||
: super core::Object::•() | ||
; | ||
} | ||
class D5 extends core::Object implements self::C, self::C { | ||
synthetic constructor •() → self::D5 | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class _CM&C&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM&C&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM extends self::_CM&C&C /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM2&C&CAlias extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM2&C&CAlias | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM2 extends self::_CM2&C&CAlias /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM3&CAlias&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM3&CAlias&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM3 extends self::_CM3&CAlias&C /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM4&C&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM4&C&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM4 extends self::_CM4&C&C /*isMixinDeclaration*/ { | ||
} | ||
abstract class _CM5&C&C extends core::Object implements self::C, self::C /*isAnonymousMixin*/ { | ||
synthetic constructor •() → self::_CM5&C&C | ||
: super core::Object::•() | ||
; | ||
} | ||
abstract class CM5 extends self::_CM5&C&C /*isMixinDeclaration*/ { | ||
} | ||
static method main() → dynamic {} |
22 changes: 22 additions & 0 deletions
22
pkg/front_end/testcases/nonfunction_type_aliases/issue45626.dart.textual_outline.expect
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,22 @@ | ||
import 'issue45626.dart' as self; | ||
|
||
class C {} | ||
|
||
typedef CAlias = C; | ||
|
||
class D implements C, C {} | ||
|
||
class D2 implements C, CAlias {} | ||
|
||
class D3 implements CAlias, C {} | ||
|
||
class D4 implements C, self.C {} | ||
|
||
class D5 implements self.C, C {} | ||
|
||
mixin CM on C, C {} | ||
mixin CM2 on C, CAlias {} | ||
mixin CM3 on CAlias, C {} | ||
mixin CM4 on self.C, C {} | ||
mixin CM5 on C, self.C {} | ||
main() {} |
21 changes: 21 additions & 0 deletions
21
...nt_end/testcases/nonfunction_type_aliases/issue45626.dart.textual_outline_modelled.expect
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,21 @@ | ||
import 'issue45626.dart' as self; | ||
|
||
class C {} | ||
|
||
class D implements C, C {} | ||
|
||
class D2 implements C, CAlias {} | ||
|
||
class D3 implements CAlias, C {} | ||
|
||
class D4 implements C, self.C {} | ||
|
||
class D5 implements self.C, C {} | ||
|
||
main() {} | ||
mixin CM on C, C {} | ||
mixin CM2 on C, CAlias {} | ||
mixin CM3 on CAlias, C {} | ||
mixin CM4 on self.C, C {} | ||
mixin CM5 on C, self.C {} | ||
typedef CAlias = C; |
Oops, something went wrong.