-
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.
[cfe] Require a non-null name for mixin supertypes
The function types are given an empty name in that case. Those types are further discarded and can have any intermediary name. Part of #48919 Change-Id: I57d223ee7914d0227baa3a4ef5733bb8055fa2c3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244240 Commit-Queue: Chloe Stefantsova <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
- Loading branch information
1 parent
c54ade0
commit aa9b83e
Showing
8 changed files
with
104 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2022, 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. | ||
|
||
mixin M {} | ||
class A = void Function() with M; | ||
|
||
main() {} |
3 changes: 3 additions & 0 deletions
3
pkg/front_end/testcases/general/issue48919.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,3 @@ | ||
mixin M {} | ||
class A = void Function() with M; | ||
main() {} |
19 changes: 19 additions & 0 deletions
19
pkg/front_end/testcases/general/issue48919.dart.weak.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,19 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/issue48919.dart:6:16: Error: Can't use a function type as supertype. | ||
// class A = void Function() with M; | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
abstract class M extends core::Object /*isMixinDeclaration*/ { | ||
} | ||
class A = core::Object with self::M /*hasConstConstructor*/ { | ||
const synthetic constructor •() → self::A | ||
: super core::Object::•() | ||
; | ||
} | ||
static method main() → dynamic {} |
19 changes: 19 additions & 0 deletions
19
pkg/front_end/testcases/general/issue48919.dart.weak.modular.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,19 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/issue48919.dart:6:16: Error: Can't use a function type as supertype. | ||
// class A = void Function() with M; | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
abstract class M extends core::Object /*isMixinDeclaration*/ { | ||
} | ||
class A = core::Object with self::M /*hasConstConstructor*/ { | ||
const synthetic constructor •() → self::A | ||
: super core::Object::•() | ||
; | ||
} | ||
static method main() → dynamic {} |
20 changes: 20 additions & 0 deletions
20
pkg/front_end/testcases/general/issue48919.dart.weak.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,20 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/issue48919.dart:6:16: Error: Can't use a function type as supertype. | ||
// class A = void Function() with M; | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
abstract class M extends core::Object /*isMixinDeclaration*/ { | ||
} | ||
class A = core::Object with self::M /*hasConstConstructor*/ { | ||
const synthetic constructor •() → self::A | ||
: super core::Object::•() | ||
; | ||
} | ||
static method main() → dynamic | ||
; |
19 changes: 19 additions & 0 deletions
19
pkg/front_end/testcases/general/issue48919.dart.weak.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,19 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/general/issue48919.dart:6:16: Error: Can't use a function type as supertype. | ||
// class A = void Function() with M; | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
abstract class M extends core::Object /*isMixinDeclaration*/ { | ||
} | ||
class A extends core::Object implements self::M /*isEliminatedMixin,hasConstConstructor*/ { | ||
const synthetic constructor •() → self::A | ||
: super core::Object::•() | ||
; | ||
} | ||
static method main() → dynamic {} |
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