-
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] Fix crash on extension type with duplicate name (2)
Change-Id: Id0464bbabbcbc535761acd5b2cc0082ffb8ad6b0 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397800 Commit-Queue: Jens Johansen <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
- Loading branch information
Showing
15 changed files
with
194 additions
and
21 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
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
pkg/front_end/testcases/regress/extension_type_duplicate_name_02.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. | ||
|
||
int DuplicateName = 42; | ||
|
||
extension type DuplicateName._(int _x) { | ||
static set bar(int newBar) {} | ||
int get bar => 42; | ||
} |
37 changes: 37 additions & 0 deletions
37
pkg/front_end/testcases/regress/extension_type_duplicate_name_02.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,37 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:7:16: Error: 'DuplicateName' is already declared in this scope. | ||
// extension type DuplicateName._(int _x) { | ||
// ^^^^^^^^^^^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:5:5: Context: Previous declaration of 'DuplicateName'. | ||
// int DuplicateName = 42; | ||
// ^^^^^^^^^^^^^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: 'DuplicateName' isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: Conflicts with member 'bar'. | ||
// static set bar(int newBar) {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: Conflicts with setter 'bar'. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: This static member conflicts with an instance member. | ||
// static set bar(int newBar) {} | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This is the instance member. | ||
// int get bar => 42; | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int DuplicateName = 42; |
37 changes: 37 additions & 0 deletions
37
pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart.strong.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,37 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:7:16: Error: 'DuplicateName' is already declared in this scope. | ||
// extension type DuplicateName._(int _x) { | ||
// ^^^^^^^^^^^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:5:5: Context: Previous declaration of 'DuplicateName'. | ||
// int DuplicateName = 42; | ||
// ^^^^^^^^^^^^^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: 'DuplicateName' isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: Conflicts with member 'bar'. | ||
// static set bar(int newBar) {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: Conflicts with setter 'bar'. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: This static member conflicts with an instance member. | ||
// static set bar(int newBar) {} | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This is the instance member. | ||
// int get bar => 42; | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int DuplicateName = 42; |
37 changes: 37 additions & 0 deletions
37
pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart.strong.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,37 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:7:16: Error: 'DuplicateName' is already declared in this scope. | ||
// extension type DuplicateName._(int _x) { | ||
// ^^^^^^^^^^^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:5:5: Context: Previous declaration of 'DuplicateName'. | ||
// int DuplicateName = 42; | ||
// ^^^^^^^^^^^^^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: 'DuplicateName' isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: Conflicts with member 'bar'. | ||
// static set bar(int newBar) {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: Conflicts with setter 'bar'. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: This static member conflicts with an instance member. | ||
// static set bar(int newBar) {} | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This is the instance member. | ||
// int get bar => 42; | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int DuplicateName; |
37 changes: 37 additions & 0 deletions
37
...ont_end/testcases/regress/extension_type_duplicate_name_02.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,37 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:7:16: Error: 'DuplicateName' is already declared in this scope. | ||
// extension type DuplicateName._(int _x) { | ||
// ^^^^^^^^^^^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:5:5: Context: Previous declaration of 'DuplicateName'. | ||
// int DuplicateName = 42; | ||
// ^^^^^^^^^^^^^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: 'DuplicateName' isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This isn't a type. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: Conflicts with member 'bar'. | ||
// static set bar(int newBar) {} | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Error: Conflicts with setter 'bar'. | ||
// int get bar => 42; | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:8:14: Error: This static member conflicts with an instance member. | ||
// static set bar(int newBar) {} | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/extension_type_duplicate_name_02.dart:9:11: Context: This is the instance member. | ||
// int get bar => 42; | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int DuplicateName = 42; |
6 changes: 6 additions & 0 deletions
6
pkg/front_end/testcases/regress/extension_type_duplicate_name_02.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,6 @@ | ||
int DuplicateName = 42; | ||
|
||
extension type DuplicateName._(int _x) { | ||
static set bar(int newBar) {} | ||
int get bar => 42; | ||
} |
6 changes: 6 additions & 0 deletions
6
...d/testcases/regress/extension_type_duplicate_name_02.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,6 @@ | ||
extension type DuplicateName._(int _x) { | ||
int get bar => 42; | ||
static set bar(int newBar) {} | ||
} | ||
|
||
int DuplicateName = 42; |