-
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] Fix crash caused by name clash of loadLibrary tearoff method
Fixes #39682 Change-Id: I0e326df9390e05ede939f0019e94f8abe1fb7983 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127460 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
- Loading branch information
Showing
11 changed files
with
104 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) 2019, 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.md file. | ||
|
||
import "issue_39682_lib.dart" deferred as foo; | ||
|
||
main() { | ||
var f = foo.loadLibrary; | ||
f(); | ||
print(__loadLibrary_foo()); | ||
} | ||
|
||
String __loadLibrary_foo() { | ||
return "I'll call my methods what I want!"; | ||
} |
16 changes: 16 additions & 0 deletions
16
pkg/front_end/testcases/regress/issue_39682.dart.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,16 @@ | ||
library; | ||
import self as self; | ||
import "dart:core" as core; | ||
|
||
import "org-dartlang-testcase:///issue_39682_lib.dart" deferred as foo; | ||
|
||
static method main() → dynamic | ||
; | ||
static method __loadLibrary_foo() → core::String* | ||
; | ||
|
||
library; | ||
import self as self2; | ||
|
||
static method foo() → dynamic | ||
; |
29 changes: 29 additions & 0 deletions
29
pkg/front_end/testcases/regress/issue_39682.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,29 @@ | ||
library; | ||
import self as self; | ||
import "dart:async" as asy; | ||
import "dart:core" as core; | ||
|
||
import "org-dartlang-testcase:///issue_39682_lib.dart" deferred as foo; | ||
|
||
static method main() → dynamic { | ||
() →* asy::Future<dynamic>* f = #C1; | ||
f.call(); | ||
core::print(self::__loadLibrary_foo()); | ||
} | ||
static method __loadLibrary_foo() → core::String* { | ||
return "I'll call my methods what I want!"; | ||
} | ||
static method _#loadLibrary_foo() → asy::Future<dynamic>* | ||
return LoadLibrary(foo); | ||
|
||
library; | ||
import self as self2; | ||
import "dart:core" as core; | ||
|
||
static method foo() → dynamic { | ||
core::print("foo!"); | ||
} | ||
|
||
constants { | ||
#C1 = tearoff self::_#loadLibrary_foo | ||
} |
29 changes: 29 additions & 0 deletions
29
pkg/front_end/testcases/regress/issue_39682.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,29 @@ | ||
library; | ||
import self as self; | ||
import "dart:async" as asy; | ||
import "dart:core" as core; | ||
|
||
import "org-dartlang-testcase:///issue_39682_lib.dart" deferred as foo; | ||
|
||
static method main() → dynamic { | ||
() →* asy::Future<dynamic>* f = #C1; | ||
f.call(); | ||
core::print(self::__loadLibrary_foo()); | ||
} | ||
static method __loadLibrary_foo() → core::String* { | ||
return "I'll call my methods what I want!"; | ||
} | ||
static method _#loadLibrary_foo() → asy::Future<dynamic>* | ||
return LoadLibrary(foo); | ||
|
||
library; | ||
import self as self2; | ||
import "dart:core" as core; | ||
|
||
static method foo() → dynamic { | ||
core::print("foo!"); | ||
} | ||
|
||
constants { | ||
#C1 = tearoff self::_#loadLibrary_foo | ||
} |
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,7 @@ | ||
// Copyright (c) 2019, 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.md file. | ||
|
||
foo() { | ||
print("foo!"); | ||
} |
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