0c8ded72dc
This adds FileUriConstantExpression, a subclass of ConstantExpression, to support correct file offset of annotations for augmentations and patches. The FileUriExpression is used to carry the file uri of the expression before constant evaluation. TEST=general/patch_annotations Change-Id: I0dc8a0cb97dd530fd1960785d38c2d5e4883c3dd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311660 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Jens Johansen <jensj@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
96 lines
3.0 KiB
Plaintext
96 lines
3.0 KiB
Plaintext
library;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/general/constructor_patch/main.dart:8:13: Error: Couldn't find constructor 'Class._private'.
|
|
// new Class._private(); // Error
|
|
// ^^^^^^^^
|
|
//
|
|
// pkg/front_end/testcases/general/constructor_patch/main.dart:9:13: Error: Couldn't find constructor 'Class._privateInjected'.
|
|
// new Class._privateInjected(); // Error
|
|
// ^^^^^^^^^^^^^^^^
|
|
//
|
|
import self as self;
|
|
import "dart:test" as test;
|
|
|
|
import "dart:test";
|
|
|
|
static method test() → dynamic {
|
|
invalid-expression "pkg/front_end/testcases/general/constructor_patch/main.dart:8:13: Error: Couldn't find constructor 'Class._private'.
|
|
new Class._private(); // Error
|
|
^^^^^^^^";
|
|
invalid-expression "pkg/front_end/testcases/general/constructor_patch/main.dart:9:13: Error: Couldn't find constructor 'Class._privateInjected'.
|
|
new Class._privateInjected(); // Error
|
|
^^^^^^^^^^^^^^^^";
|
|
}
|
|
static method main() → dynamic {
|
|
new test::Class::generative();
|
|
#C2;
|
|
}
|
|
|
|
library;
|
|
import self as test;
|
|
import "dart:_internal" as _in;
|
|
import "dart:core" as core;
|
|
|
|
import "dart:_internal";
|
|
|
|
@/* from org-dartlang-testcase:///patch_lib.dart */ #C3
|
|
class Class extends core::Object /*hasConstConstructor*/ {
|
|
final field core::bool defaultValue /* from org-dartlang-testcase:///patch_lib.dart */;
|
|
constructor _privateInjected() → test::Class
|
|
: test::Class::defaultValue = false, super core::Object::•()
|
|
;
|
|
constructor redirect() → test::Class
|
|
: this test::Class::_private()
|
|
;
|
|
constructor redirectInjected() → test::Class
|
|
: this test::Class::_privateInjected()
|
|
;
|
|
@#C3
|
|
constructor generative({core::bool defaultValue = #C1}) → test::Class
|
|
: test::Class::defaultValue = defaultValue, super core::Object::•()
|
|
;
|
|
@#C3
|
|
const constructor constGenerative({core::bool defaultValue = #C1}) → test::Class
|
|
: test::Class::defaultValue = defaultValue, super core::Object::•()
|
|
;
|
|
@#C3
|
|
constructor _private() → test::Class
|
|
: test::Class::defaultValue = true, super core::Object::•()
|
|
;
|
|
}
|
|
@/* from org-dartlang-testcase:///patch_lib.dart */ #C3
|
|
class Class2 extends core::Object {
|
|
final field core::int injectedField /* from org-dartlang-testcase:///patch_lib.dart */;
|
|
field core::int field;
|
|
@#C3
|
|
constructor •(core::int field) → test::Class2
|
|
: test::Class2::field = field, test::Class2::injectedField = field, super core::Object::•()
|
|
;
|
|
}
|
|
class Subclass extends test::Class {
|
|
constructor private() → test::Subclass
|
|
: super test::Class::_private()
|
|
;
|
|
constructor privateInjected() → test::Subclass
|
|
: super test::Class::_privateInjected()
|
|
;
|
|
}
|
|
static method test() → dynamic {
|
|
new test::Class::_private();
|
|
new test::Class::_privateInjected();
|
|
}
|
|
|
|
constants {
|
|
#C1 = true
|
|
#C2 = test::Class {defaultValue:#C1}
|
|
#C3 = _in::_Patch {}
|
|
}
|
|
|
|
|
|
Constructor coverage from constants:
|
|
org-dartlang-testcase:///main.dart:
|
|
- Class.constGenerative (from org-dartlang-testcase:///patch_lib.dart:16:9)
|
|
- Object. (from org-dartlang-sdk:///sdk/lib/core/object.dart)
|