forked from flutter/engine
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'e0f45c2cdf3fed270ffbcf23b28cf0ad09c38337' into 'dev'
- Loading branch information
Showing
37 changed files
with
715 additions
and
40 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
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
20 changes: 20 additions & 0 deletions
20
pkg/front_end/testcases/extension_types/simple_method_resolution.dart
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 @@ | ||
// Copyright (c) 2021, 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 { | ||
void foo() {} | ||
} | ||
|
||
extension E on A { | ||
void bar() => foo(); | ||
} | ||
|
||
test(A a, E e) { | ||
a.foo(); // Ok. | ||
a.bar(); // Ok. | ||
e.foo(); // Error. | ||
e.bar(); // Ok. | ||
} | ||
|
||
main() {} |
36 changes: 36 additions & 0 deletions
36
pkg/front_end/testcases/extension_types/simple_method_resolution.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,36 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/simple_method_resolution.dart:16:5: Error: The method 'foo' isn't defined for the extension 'E'. | ||
// Try correcting the name to the name of an existing method, or defining a method name 'foo'. | ||
// e.foo(); // Error. | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A extends core::Object { | ||
synthetic constructor •() → self::A | ||
: super core::Object::•() | ||
; | ||
method foo() → void {} | ||
} | ||
extension E on self::A { | ||
method bar = self::E|bar; | ||
tearoff bar = self::E|get#bar; | ||
} | ||
static method E|bar(lowered final self::A #this) → void | ||
return #this.{self::A::foo}(); | ||
static method E|get#bar(lowered final self::A #this) → () → void | ||
return () → void => self::E|bar(#this); | ||
static method test(self::A a, self::E e) → dynamic { | ||
a.{self::A::foo}(); | ||
self::E|bar(a); | ||
invalid-expression "pkg/front_end/testcases/extension_types/simple_method_resolution.dart:16:5: Error: The method 'foo' isn't defined for the extension 'E'. | ||
Try correcting the name to the name of an existing method, or defining a method name 'foo'. | ||
e.foo(); // Error. | ||
^^^"; | ||
self::E|bar(e); | ||
} | ||
static method main() → dynamic {} |
36 changes: 36 additions & 0 deletions
36
...ont_end/testcases/extension_types/simple_method_resolution.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,36 @@ | ||
library /*isNonNullableByDefault*/; | ||
// | ||
// Problems in library: | ||
// | ||
// pkg/front_end/testcases/extension_types/simple_method_resolution.dart:16:5: Error: The method 'foo' isn't defined for the extension 'E'. | ||
// Try correcting the name to the name of an existing method, or defining a method name 'foo'. | ||
// e.foo(); // Error. | ||
// ^^^ | ||
// | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
class A extends core::Object { | ||
synthetic constructor •() → self::A | ||
: super core::Object::•() | ||
; | ||
method foo() → void {} | ||
} | ||
extension E on self::A { | ||
method bar = self::E|bar; | ||
tearoff bar = self::E|get#bar; | ||
} | ||
static method E|bar(lowered final self::A #this) → void | ||
return #this.{self::A::foo}(); | ||
static method E|get#bar(lowered final self::A #this) → () → void | ||
return () → void => self::E|bar(#this); | ||
static method test(self::A a, self::E e) → dynamic { | ||
a.{self::A::foo}(); | ||
self::E|bar(a); | ||
invalid-expression "pkg/front_end/testcases/extension_types/simple_method_resolution.dart:16:5: Error: The method 'foo' isn't defined for the extension 'E'. | ||
Try correcting the name to the name of an existing method, or defining a method name 'foo'. | ||
e.foo(); // Error. | ||
^^^"; | ||
self::E|bar(e); | ||
} | ||
static method main() → dynamic {} |
10 changes: 10 additions & 0 deletions
10
pkg/front_end/testcases/extension_types/simple_method_resolution.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,10 @@ | ||
class A { | ||
void foo() {} | ||
} | ||
|
||
extension E on A { | ||
void bar() => foo(); | ||
} | ||
|
||
test(A a, E e) {} | ||
main() {} |
10 changes: 10 additions & 0 deletions
10
...d/testcases/extension_types/simple_method_resolution.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,10 @@ | ||
class A { | ||
void foo() {} | ||
} | ||
|
||
extension E on A { | ||
void bar() => foo(); | ||
} | ||
|
||
main() {} | ||
test(A a, E e) {} |
Oops, something went wrong.