-
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 AmbiguousBuilder in handleUnaryPrefixExpression
Change-Id: I76fb3f77f9ffbbe6a7ecb892d3a5a21019b66371 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394500 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Jens Johansen <[email protected]>
- Loading branch information
Showing
8 changed files
with
115 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) 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. | ||
|
||
class Bar { | ||
get foo => 42; | ||
get foo => ~foo; | ||
} |
25 changes: 25 additions & 0 deletions
25
pkg/front_end/testcases/regress/ambiguous_builder_03.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,25 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:7:7: Error: 'foo' is already declared in this scope. | ||
// get foo => ~foo; | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:6:7: Context: Previous declaration of 'foo'. | ||
// get foo => 42; | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:7:15: Error: Can't use 'foo' because it is declared more than once. | ||
// get foo => ~foo; | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class Bar extends core::Object { | ||
synthetic constructor •() → self::Bar | ||
: super core::Object::•() | ||
; | ||
get foo() → dynamic | ||
return 42; | ||
} |
25 changes: 25 additions & 0 deletions
25
pkg/front_end/testcases/regress/ambiguous_builder_03.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,25 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:7:7: Error: 'foo' is already declared in this scope. | ||
// get foo => ~foo; | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:6:7: Context: Previous declaration of 'foo'. | ||
// get foo => 42; | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:7:15: Error: Can't use 'foo' because it is declared more than once. | ||
// get foo => ~foo; | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class Bar extends core::Object { | ||
synthetic constructor •() → self::Bar | ||
: super core::Object::•() | ||
; | ||
get foo() → dynamic | ||
return 42; | ||
} |
20 changes: 20 additions & 0 deletions
20
pkg/front_end/testcases/regress/ambiguous_builder_03.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,20 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:7:7: Error: 'foo' is already declared in this scope. | ||
// get foo => ~foo; | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:6:7: Context: Previous declaration of 'foo'. | ||
// get foo => 42; | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class Bar extends core::Object { | ||
synthetic constructor •() → self::Bar | ||
; | ||
get foo() → dynamic | ||
; | ||
} |
25 changes: 25 additions & 0 deletions
25
pkg/front_end/testcases/regress/ambiguous_builder_03.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,25 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:7:7: Error: 'foo' is already declared in this scope. | ||
// get foo => ~foo; | ||
// ^^^ | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:6:7: Context: Previous declaration of 'foo'. | ||
// get foo => 42; | ||
// ^^^ | ||
// | ||
// pkg/front_end/testcases/regress/ambiguous_builder_03.dart:7:15: Error: Can't use 'foo' because it is declared more than once. | ||
// get foo => ~foo; | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class Bar extends core::Object { | ||
synthetic constructor •() → self::Bar | ||
: super core::Object::•() | ||
; | ||
get foo() → dynamic | ||
return 42; | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/front_end/testcases/regress/ambiguous_builder_03.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,4 @@ | ||
class Bar { | ||
get foo => 42; | ||
get foo => ~foo; | ||
} |
4 changes: 4 additions & 0 deletions
4
pkg/front_end/testcases/regress/ambiguous_builder_03.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,4 @@ | ||
class Bar { | ||
get foo => 42; | ||
get foo => ~foo; | ||
} |