-
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.
Merge c6362da into dev
- Loading branch information
Showing
20 changed files
with
419 additions
and
126 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
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
10 changes: 10 additions & 0 deletions
10
pkg/front_end/testcases/regress/duplicate_enum_constructor.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,10 @@ | ||
// Copyright (c) 2024, 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. | ||
|
||
enum Foo { | ||
a, b; | ||
|
||
const Foo(); | ||
const Foo(); | ||
} |
41 changes: 41 additions & 0 deletions
41
pkg/front_end/testcases/regress/duplicate_enum_constructor.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,41 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_enum_constructor.dart:9:9: Error: 'Foo' is already declared in this scope. | ||
// const Foo(); | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/duplicate_enum_constructor.dart:8:9: Context: Previous declaration of 'Foo'. | ||
// const Foo(); | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class Foo extends core::_Enum /*isEnum*/ { | ||
static const field core::List<self::Foo> values = #C7; | ||
enum-element static const field self::Foo a = #C3; | ||
enum-element static const field self::Foo b = #C6; | ||
const constructor •(core::int #index, core::String #name) → self::Foo | ||
: super core::_Enum::•(#index, #name) | ||
; | ||
method _enumToString() → core::String | ||
return "Foo.${this.{core::_Enum::_name}{core::String}}"; | ||
} | ||
|
||
constants { | ||
#C1 = 0 | ||
#C2 = "a" | ||
#C3 = self::Foo {index:#C1, _name:#C2} | ||
#C4 = 1 | ||
#C5 = "b" | ||
#C6 = self::Foo {index:#C4, _name:#C5} | ||
#C7 = <self::Foo>[#C3, #C6] | ||
} | ||
|
||
|
||
Constructor coverage from constants: | ||
org-dartlang-testcase:///duplicate_enum_constructor.dart: | ||
- Foo. (from org-dartlang-testcase:///duplicate_enum_constructor.dart:8:9) | ||
- _Enum. (from org-dartlang-sdk:///sdk/lib/core/enum.dart) | ||
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart) |
Oops, something went wrong.