-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cfe] Pass pre-parsed initializers to resolve super-initizer target
Closes dart-lang/sdk#48286 Part of dart-lang/sdk#47525 Change-Id: Ie8816c407b7ab1b6510e5cf139b88c33728f55a8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231948 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
- Loading branch information
1 parent
0c7bf4b
commit 6939628
Showing
17 changed files
with
214 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) 2022, 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 S<T> { | ||
num n; | ||
T t; | ||
S(this.n, this.t); | ||
S.named(this.t, this.n); | ||
} | ||
|
||
class C<T> extends S<T> { | ||
C.constr1(super.n, String s, super.t); | ||
C.constr2(int i, super.n, String s, super.t) : super(); | ||
C.constr3(int i, super.t, String s, super.n) : super.named(); | ||
} | ||
|
||
main() {} |
26 changes: 26 additions & 0 deletions
26
pkg/front_end/testcases/super_parameters/issue48286.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,26 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class S<T extends core::Object? = dynamic> extends core::Object { | ||
field core::num n; | ||
covariant-by-class field self::S::T% t; | ||
constructor •(core::num n, self::S::T% t) → self::S<self::S::T%> | ||
: self::S::n = n, self::S::t = t, super core::Object::•() | ||
; | ||
constructor named(self::S::T% t, core::num n) → self::S<self::S::T%> | ||
: self::S::t = t, self::S::n = n, super core::Object::•() | ||
; | ||
} | ||
class C<T extends core::Object? = dynamic> extends self::S<self::C::T%> { | ||
constructor constr1(core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr2(core::int i, core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr3(core::int i, self::C::T% t, core::String s, core::num n) → self::C<self::C::T%> | ||
: super self::S::named(t, n) | ||
; | ||
} | ||
static method main() → dynamic {} |
26 changes: 26 additions & 0 deletions
26
pkg/front_end/testcases/super_parameters/issue48286.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,26 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class S<T extends core::Object? = dynamic> extends core::Object { | ||
field core::num n; | ||
covariant-by-class field self::S::T% t; | ||
constructor •(core::num n, self::S::T% t) → self::S<self::S::T%> | ||
: self::S::n = n, self::S::t = t, super core::Object::•() | ||
; | ||
constructor named(self::S::T% t, core::num n) → self::S<self::S::T%> | ||
: self::S::t = t, self::S::n = n, super core::Object::•() | ||
; | ||
} | ||
class C<T extends core::Object? = dynamic> extends self::S<self::C::T%> { | ||
constructor constr1(core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr2(core::int i, core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr3(core::int i, self::C::T% t, core::String s, core::num n) → self::C<self::C::T%> | ||
: super self::S::named(t, n) | ||
; | ||
} | ||
static method main() → dynamic {} |
12 changes: 12 additions & 0 deletions
12
pkg/front_end/testcases/super_parameters/issue48286.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,12 @@ | ||
class S<T> { | ||
num n; | ||
T t; | ||
S(this.n, this.t); | ||
S.named(this.t, this.n); | ||
} | ||
class C<T> extends S<T> { | ||
C.constr1(super.n, String s, super.t); | ||
C.constr2(int i, super.n, String s, super.t) : super(); | ||
C.constr3(int i, super.t, String s, super.n) : super.named(); | ||
} | ||
main() {} |
26 changes: 26 additions & 0 deletions
26
pkg/front_end/testcases/super_parameters/issue48286.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,26 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class S<T extends core::Object? = dynamic> extends core::Object { | ||
field core::num n; | ||
covariant-by-class field self::S::T% t; | ||
constructor •(core::num n, self::S::T% t) → self::S<self::S::T%> | ||
: self::S::n = n, self::S::t = t, super core::Object::•() | ||
; | ||
constructor named(self::S::T% t, core::num n) → self::S<self::S::T%> | ||
: self::S::t = t, self::S::n = n, super core::Object::•() | ||
; | ||
} | ||
class C<T extends core::Object? = dynamic> extends self::S<self::C::T%> { | ||
constructor constr1(core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr2(core::int i, core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr3(core::int i, self::C::T% t, core::String s, core::num n) → self::C<self::C::T%> | ||
: super self::S::named(t, n) | ||
; | ||
} | ||
static method main() → dynamic {} |
26 changes: 26 additions & 0 deletions
26
pkg/front_end/testcases/super_parameters/issue48286.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,26 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class S<T extends core::Object? = dynamic> extends core::Object { | ||
field core::num n; | ||
covariant-by-class field self::S::T% t; | ||
constructor •(core::num n, self::S::T% t) → self::S<self::S::T%> | ||
: self::S::n = n, self::S::t = t, super core::Object::•() | ||
; | ||
constructor named(self::S::T% t, core::num n) → self::S<self::S::T%> | ||
: self::S::t = t, self::S::n = n, super core::Object::•() | ||
; | ||
} | ||
class C<T extends core::Object? = dynamic> extends self::S<self::C::T%> { | ||
constructor constr1(core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr2(core::int i, core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr3(core::int i, self::C::T% t, core::String s, core::num n) → self::C<self::C::T%> | ||
: super self::S::named(t, n) | ||
; | ||
} | ||
static method main() → dynamic {} |
22 changes: 22 additions & 0 deletions
22
pkg/front_end/testcases/super_parameters/issue48286.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,22 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class S<T extends core::Object? = dynamic> extends core::Object { | ||
field core::num n; | ||
covariant-by-class field self::S::T% t; | ||
constructor •(core::num n, self::S::T% t) → self::S<self::S::T%> | ||
; | ||
constructor named(self::S::T% t, core::num n) → self::S<self::S::T%> | ||
; | ||
} | ||
class C<T extends core::Object? = dynamic> extends self::S<self::C::T%> { | ||
constructor constr1(core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
; | ||
constructor constr2(core::int i, core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
; | ||
constructor constr3(core::int i, self::C::T% t, core::String s, core::num n) → self::C<self::C::T%> | ||
; | ||
} | ||
static method main() → dynamic | ||
; |
26 changes: 26 additions & 0 deletions
26
pkg/front_end/testcases/super_parameters/issue48286.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,26 @@ | ||
library /*isNonNullableByDefault*/; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class S<T extends core::Object? = dynamic> extends core::Object { | ||
field core::num n; | ||
covariant-by-class field self::S::T% t; | ||
constructor •(core::num n, self::S::T% t) → self::S<self::S::T%> | ||
: self::S::n = n, self::S::t = t, super core::Object::•() | ||
; | ||
constructor named(self::S::T% t, core::num n) → self::S<self::S::T%> | ||
: self::S::t = t, self::S::n = n, super core::Object::•() | ||
; | ||
} | ||
class C<T extends core::Object? = dynamic> extends self::S<self::C::T%> { | ||
constructor constr1(core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr2(core::int i, core::num n, core::String s, self::C::T% t) → self::C<self::C::T%> | ||
: super self::S::•(n, t) | ||
; | ||
constructor constr3(core::int i, self::C::T% t, core::String s, core::num n) → self::C<self::C::T%> | ||
: super self::S::named(t, n) | ||
; | ||
} | ||
static method main() → dynamic {} |
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
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