Skip to content

Commit

Permalink
Version 3.6.0-232.0.dev
Browse files Browse the repository at this point in the history
Merge 5a4bcb2 into dev
  • Loading branch information
Dart CI committed Sep 10, 2024
2 parents 4c4def6 + 5a4bcb2 commit a60078a
Show file tree
Hide file tree
Showing 33 changed files with 762 additions and 687 deletions.
4 changes: 2 additions & 2 deletions build/gn_run_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def run_command(command):
subprocess.check_output(command, stderr=subprocess.STDOUT)
return 0
except subprocess.CalledProcessError as e:
return ("Command failed: " + ' '.join(command) + "\n" + "output: " +
_decode(e.output))
return ("Command failed: " + ' '.join(command) + "\n" + "exitCode: " +
str(e.returncode) + "\n" + "output: " + _decode(e.output))
except OSError as e:
return ("Command failed: " + ' '.join(command) + "\n" + "output: " +
_decode(e.strerror))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class ExtensionMemberResolver {
/// returns [ResolutionResult.ambiguous].
ResolutionResult findExtension(
DartType type, SyntacticEntity nameEntity, Name name) {
var extensions = _resolver.definingLibrary.accessibleExtensions
var extensions = _resolver.libraryFragment.scope.accessibleExtensions
.havingMemberWithBaseName(name)
.applicableTo(
targetLibrary: _resolver.definingLibrary,
Expand Down
41 changes: 41 additions & 0 deletions pkg/analyzer/test/src/dart/resolution/extension_method_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,47 @@ MethodInvocation
''');
}

test_instance_method_fromInstance_importInPart() async {
newFile('$testPackageLibPath/x.dart', r'''
extension E on int {
void foo() {}
}
''');

newFile('$testPackageLibPath/a.dart', r'''
part 'b.dart';
''');

var b = newFile('$testPackageLibPath/b.dart', r'''
part of 'a.dart';
import 'x.dart';
void f() {
0.foo();
}
''');

await resolveFile2(b);
assertErrorsInResult([]);

var node = findNode.singleMethodInvocation;
assertResolvedNodeText(node, r'''
MethodInvocation
target: IntegerLiteral
literal: 0
staticType: int
operator: .
methodName: SimpleIdentifier
token: foo
staticElement: package:test/x.dart::<fragment>::@extension::E::@method::foo
staticType: void Function()
argumentList: ArgumentList
leftParenthesis: (
rightParenthesis: )
staticInvokeType: void Function()
staticType: void
''');
}

test_instance_method_fromInstance_Never() async {
await assertErrorsInCode('''
extension E on Never {
Expand Down
Loading

0 comments on commit a60078a

Please sign in to comment.