-
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] Account for extension type self-dependency via raw types
Closes #54241 Change-Id: I7afcaab225f93763f0dd2852bb51227c05abe4bb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340403 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Chloe Stefantsova <[email protected]>
- Loading branch information
1 parent
d0aa049
commit 408e486
Showing
10 changed files
with
236 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,6 @@ | ||
// Copyright (c) 2023, 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 A<X extends E> {} | ||
extension type E(Function<Y extends A>() it) {} |
27 changes: 27 additions & 0 deletions
27
pkg/front_end/testcases/extension_types/issue54241.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,27 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/issue54241.dart:6:18: Error: An extension type can't depend on itself through its representation type. | ||
// extension type E(Function<Y extends A>() it) {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A<X extends self::E /* = invalid-type */> extends core::Object { | ||
synthetic constructor •() → self::A<self::A::X%> | ||
: super core::Object::•() | ||
; | ||
} | ||
extension type E(invalid-type it) { | ||
abstract extension-type-member representation-field get it() → <Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic; | ||
constructor • = self::E|constructor#; | ||
constructor tearoff • = self::E|constructor#_#new#tearOff; | ||
} | ||
static extension-type-member method E|constructor#(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ { | ||
lowered final self::E /* = invalid-type */ #this = it; | ||
return #this; | ||
} | ||
static extension-type-member method E|constructor#_#new#tearOff(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ | ||
return self::E|constructor#(it); |
27 changes: 27 additions & 0 deletions
27
pkg/front_end/testcases/extension_types/issue54241.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,27 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/issue54241.dart:6:18: Error: An extension type can't depend on itself through its representation type. | ||
// extension type E(Function<Y extends A>() it) {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A<X extends self::E /* = invalid-type */> extends core::Object { | ||
synthetic constructor •() → self::A<self::A::X%> | ||
: super core::Object::•() | ||
; | ||
} | ||
extension type E(invalid-type it) { | ||
abstract extension-type-member representation-field get it() → <Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic; | ||
constructor • = self::E|constructor#; | ||
constructor tearoff • = self::E|constructor#_#new#tearOff; | ||
} | ||
static extension-type-member method E|constructor#(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ { | ||
lowered final self::E /* = invalid-type */ #this = it; | ||
return #this; | ||
} | ||
static extension-type-member method E|constructor#_#new#tearOff(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ | ||
return self::E|constructor#(it); |
3 changes: 3 additions & 0 deletions
3
pkg/front_end/testcases/extension_types/issue54241.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,3 @@ | ||
class A<X extends E> {} | ||
|
||
extension type E(Function<Y extends A>() it) {} |
3 changes: 3 additions & 0 deletions
3
pkg/front_end/testcases/extension_types/issue54241.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,3 @@ | ||
class A<X extends E> {} | ||
|
||
extension type E(Function<Y extends A>() it) {} |
27 changes: 27 additions & 0 deletions
27
pkg/front_end/testcases/extension_types/issue54241.dart.weak.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,27 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/issue54241.dart:6:18: Error: An extension type can't depend on itself through its representation type. | ||
// extension type E(Function<Y extends A>() it) {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A<X extends self::E /* = invalid-type */> extends core::Object { | ||
synthetic constructor •() → self::A<self::A::X%> | ||
: super core::Object::•() | ||
; | ||
} | ||
extension type E(invalid-type it) { | ||
abstract extension-type-member representation-field get it() → <Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic; | ||
constructor • = self::E|constructor#; | ||
constructor tearoff • = self::E|constructor#_#new#tearOff; | ||
} | ||
static extension-type-member method E|constructor#(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ { | ||
lowered final self::E /* = invalid-type */ #this = it; | ||
return #this; | ||
} | ||
static extension-type-member method E|constructor#_#new#tearOff(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ | ||
return self::E|constructor#(it); |
27 changes: 27 additions & 0 deletions
27
pkg/front_end/testcases/extension_types/issue54241.dart.weak.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,27 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/issue54241.dart:6:18: Error: An extension type can't depend on itself through its representation type. | ||
// extension type E(Function<Y extends A>() it) {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A<X extends self::E /* = invalid-type */> extends core::Object { | ||
synthetic constructor •() → self::A<self::A::X%> | ||
: super core::Object::•() | ||
; | ||
} | ||
extension type E(invalid-type it) { | ||
abstract extension-type-member representation-field get it() → <Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic; | ||
constructor • = self::E|constructor#; | ||
constructor tearoff • = self::E|constructor#_#new#tearOff; | ||
} | ||
static extension-type-member method E|constructor#(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ { | ||
lowered final self::E /* = invalid-type */ #this = it; | ||
return #this; | ||
} | ||
static extension-type-member method E|constructor#_#new#tearOff(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ | ||
return self::E|constructor#(it); |
24 changes: 24 additions & 0 deletions
24
pkg/front_end/testcases/extension_types/issue54241.dart.weak.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,24 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/issue54241.dart:6:18: Error: An extension type can't depend on itself through its representation type. | ||
// extension type E(Function<Y extends A>() it) {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A<X extends self::E /* = invalid-type */> extends core::Object { | ||
synthetic constructor •() → self::A<self::A::X%> | ||
; | ||
} | ||
extension type E(invalid-type it) { | ||
abstract extension-type-member representation-field get it() → <Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic; | ||
constructor • = self::E|constructor#; | ||
constructor tearoff • = self::E|constructor#_#new#tearOff; | ||
} | ||
static extension-type-member method E|constructor#(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ | ||
; | ||
static extension-type-member method E|constructor#_#new#tearOff(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ | ||
return self::E|constructor#(it); |
27 changes: 27 additions & 0 deletions
27
pkg/front_end/testcases/extension_types/issue54241.dart.weak.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,27 @@ | ||
library; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/issue54241.dart:6:18: Error: An extension type can't depend on itself through its representation type. | ||
// extension type E(Function<Y extends A>() it) {} | ||
// ^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A<X extends self::E /* = invalid-type */> extends core::Object { | ||
synthetic constructor •() → self::A<self::A::X%> | ||
: super core::Object::•() | ||
; | ||
} | ||
extension type E(invalid-type it) { | ||
abstract extension-type-member representation-field get it() → <Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic; | ||
constructor • = self::E|constructor#; | ||
constructor tearoff • = self::E|constructor#_#new#tearOff; | ||
} | ||
static extension-type-member method E|constructor#(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ { | ||
lowered final self::E /* = invalid-type */ #this = it; | ||
return #this; | ||
} | ||
static extension-type-member method E|constructor#_#new#tearOff(<Y extends self::A<self::E /* = invalid-type */> = dynamic>() → dynamic it) → self::E /* = invalid-type */ | ||
return self::E|constructor#(it); |