Skip to content

Commit 77ec617

Browse files
johnniwintherCommit Queue
authored and
Commit Queue
committed
[cfe] Add test for issue 53610
Closes #53610 Change-Id: Id8efa1cc31617fdd0f323cc1397db4c7519b370a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335522 Commit-Queue: Johnni Winther <[email protected]> Reviewed-by: Jens Johansen <[email protected]>
1 parent a0bb10b commit 77ec617

9 files changed

+123
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
extension type const N(Null _) {}
6+
7+
void main() {
8+
var n = N(null);
9+
const cn = N(null);
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
library;
2+
import self as self;
3+
4+
extension type N(Null _) {
5+
abstract extension-type-member representation-field get _() → Null;
6+
constructor • = self::N|constructor#;
7+
constructor tearoff • = self::N|constructor#_#new#tearOff;
8+
}
9+
static extension-type-member method N|constructor#(Null _) → self::N /* = Null */ {
10+
lowered final self::N /* = Null */ #this = _;
11+
return #this;
12+
}
13+
static extension-type-member method N|constructor#_#new#tearOff(Null _) → self::N /* = Null */
14+
return self::N|constructor#(_);
15+
static method main() → void {
16+
self::N /* = Null */ n = self::N|constructor#(null);
17+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
library;
2+
import self as self;
3+
4+
extension type N(Null _) {
5+
abstract extension-type-member representation-field get _() → Null;
6+
constructor • = self::N|constructor#;
7+
constructor tearoff • = self::N|constructor#_#new#tearOff;
8+
}
9+
static extension-type-member method N|constructor#(Null _) → self::N /* = Null */ {
10+
lowered final self::N /* = Null */ #this = _;
11+
return #this;
12+
}
13+
static extension-type-member method N|constructor#_#new#tearOff(Null _) → self::N /* = Null */
14+
return self::N|constructor#(_);
15+
static method main() → void {
16+
self::N /* = Null */ n = self::N|constructor#(null);
17+
}
18+
19+
20+
Extra constant evaluation status:
21+
Evaluated: FactoryConstructorInvocation @ org-dartlang-testcase:///issue53610.dart:8:11 -> NullConstant(null)
22+
Extra constant evaluation: evaluated: 5, effectively constant: 1
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
extension type const N(Null _) {}
2+
void main() {}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
extension type const N(Null _) {}
2+
void main() {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
library;
2+
import self as self;
3+
4+
extension type N(Null _) {
5+
abstract extension-type-member representation-field get _() → Null;
6+
constructor • = self::N|constructor#;
7+
constructor tearoff • = self::N|constructor#_#new#tearOff;
8+
}
9+
static extension-type-member method N|constructor#(Null _) → self::N /* = Null */ {
10+
lowered final self::N /* = Null */ #this = _;
11+
return #this;
12+
}
13+
static extension-type-member method N|constructor#_#new#tearOff(Null _) → self::N /* = Null */
14+
return self::N|constructor#(_);
15+
static method main() → void {
16+
self::N /* = Null */ n = self::N|constructor#(null);
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
library;
2+
import self as self;
3+
4+
extension type N(Null _) {
5+
abstract extension-type-member representation-field get _() → Null;
6+
constructor • = self::N|constructor#;
7+
constructor tearoff • = self::N|constructor#_#new#tearOff;
8+
}
9+
static extension-type-member method N|constructor#(Null _) → self::N /* = Null */ {
10+
lowered final self::N /* = Null */ #this = _;
11+
return #this;
12+
}
13+
static extension-type-member method N|constructor#_#new#tearOff(Null _) → self::N /* = Null */
14+
return self::N|constructor#(_);
15+
static method main() → void {
16+
self::N /* = Null */ n = self::N|constructor#(null);
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
library;
2+
import self as self;
3+
4+
extension type N(Null _) {
5+
abstract extension-type-member representation-field get _() → Null;
6+
constructor • = self::N|constructor#;
7+
constructor tearoff • = self::N|constructor#_#new#tearOff;
8+
}
9+
static extension-type-member method N|constructor#(Null _) → self::N /* = Null */
10+
;
11+
static extension-type-member method N|constructor#_#new#tearOff(Null _) → self::N /* = Null */
12+
return self::N|constructor#(_);
13+
static method main() → void
14+
;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
library;
2+
import self as self;
3+
4+
extension type N(Null _) {
5+
abstract extension-type-member representation-field get _() → Null;
6+
constructor • = self::N|constructor#;
7+
constructor tearoff • = self::N|constructor#_#new#tearOff;
8+
}
9+
static extension-type-member method N|constructor#(Null _) → self::N /* = Null */ {
10+
lowered final self::N /* = Null */ #this = _;
11+
return #this;
12+
}
13+
static extension-type-member method N|constructor#_#new#tearOff(Null _) → self::N /* = Null */
14+
return self::N|constructor#(_);
15+
static method main() → void {
16+
self::N /* = Null */ n = self::N|constructor#(null);
17+
}
18+
19+
20+
Extra constant evaluation status:
21+
Evaluated: FactoryConstructorInvocation @ org-dartlang-testcase:///issue53610.dart:8:11 -> NullConstant(null)
22+
Extra constant evaluation: evaluated: 5, effectively constant: 1

0 commit comments

Comments
 (0)