Skip to content

Commit

Permalink
Fixes #3039. Fix the new roll failures (#3040)
Browse files Browse the repository at this point in the history
Fix the new roll failures
  • Loading branch information
sgrekhov authored Jan 10, 2025
1 parent 8512afe commit 2424cfe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/// @description Checks that it is a compile-time error when a constant
/// constructor's initializer list contains a function call.
/// @author iefremov
/// @issue 59804
f1() {}
int f2() => 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class C {

extension type const ET(String value) {
const ET.id(this.value, [String s = ""]);
const factory ET.f(String value, {String s = ""}) = ET;
const ET.id2(this.value, {String s = ""});
const factory ET.f(String value, {String s}) = ET.id2;
}

main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ class C {
}

mixin M {
final String value;
static const M instance = MO("M instance");
static const M instance = MO();
}
class MO with M {
final String value = "M instance";
const MO();
}

class MO = Object with M;

extension type const ET(String value) {
static const instance = ET("ET instance");
Expand All @@ -42,6 +43,9 @@ main() {
const C c = .instance;
Expect.equals("C instance", c.value);

const M m = .instance;
Expect.equals("M instance", (m as MO).value);

const ET et = .instance;
Expect.equals("ET instance", et.value);
}

0 comments on commit 2424cfe

Please sign in to comment.