-
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 with ExtensionType and duplicates causing parents not…
… to be set Change-Id: I107009e585e13082722ff33035a898185b93208a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394980 Commit-Queue: Jens Johansen <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
- Loading branch information
Showing
8 changed files
with
150 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// 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 foo = 42; | ||
|
||
extension type foo(String foo) { | ||
set foo(double x) { } | ||
} |
32 changes: 32 additions & 0 deletions
32
pkg/front_end/testcases/regress/duplicate_builder_01.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,32 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// set foo(double x) { } | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:16: Error: 'foo' is already declared in this scope. | ||
// extension type foo(String foo) { | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:5:5: Context: Previous declaration of 'foo'. | ||
// int foo = 42; | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: 'foo' isn't a type. | ||
// set foo(double x) { } | ||
// ^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Context: This isn't a type. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int foo = 42; |
32 changes: 32 additions & 0 deletions
32
pkg/front_end/testcases/regress/duplicate_builder_01.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,32 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// set foo(double x) { } | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:16: Error: 'foo' is already declared in this scope. | ||
// extension type foo(String foo) { | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:5:5: Context: Previous declaration of 'foo'. | ||
// int foo = 42; | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: 'foo' isn't a type. | ||
// set foo(double x) { } | ||
// ^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Context: This isn't a type. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int foo = 42; |
32 changes: 32 additions & 0 deletions
32
pkg/front_end/testcases/regress/duplicate_builder_01.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,32 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// set foo(double x) { } | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:16: Error: 'foo' is already declared in this scope. | ||
// extension type foo(String foo) { | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:5:5: Context: Previous declaration of 'foo'. | ||
// int foo = 42; | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: 'foo' isn't a type. | ||
// set foo(double x) { } | ||
// ^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Context: This isn't a type. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int foo; |
32 changes: 32 additions & 0 deletions
32
pkg/front_end/testcases/regress/duplicate_builder_01.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,32 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// set foo(double x) { } | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:16: Error: 'foo' is already declared in this scope. | ||
// extension type foo(String foo) { | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:5:5: Context: Previous declaration of 'foo'. | ||
// int foo = 42; | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Error: A class member can't have the same name as the enclosing class. | ||
// Try renaming the member. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:8:7: Error: 'foo' isn't a type. | ||
// set foo(double x) { } | ||
// ^ | ||
// pkg/front_end/testcases/regress/duplicate_builder_01.dart:7:27: Context: This isn't a type. | ||
// extension type foo(String foo) { | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
static field core::int foo = 42; |
5 changes: 5 additions & 0 deletions
5
pkg/front_end/testcases/regress/duplicate_builder_01.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,5 @@ | ||
int foo = 42; | ||
|
||
extension type foo(String foo) { | ||
set foo(double x) {} | ||
} |
5 changes: 5 additions & 0 deletions
5
pkg/front_end/testcases/regress/duplicate_builder_01.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,5 @@ | ||
extension type foo(String foo) { | ||
set foo(double x) {} | ||
} | ||
|
||
int foo = 42; |