Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: pkg/analyzer/test/src/summary/linker_test.dart

Issue 1981363002: In summary AST linker, fix top level isStatic getters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/linker_test.dart
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index 38838767ffd7480b17d673a9b2d95ed4b711e8d1..cae99723de080eeed203d741438d76b1562388d7 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -598,6 +598,36 @@ class D extends C {
expect(hTypeElement.typeParameterContext, same(f));
}
+ void test_topLevelFunction_isStatic() {
+ createLinker('f() {}');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ TopLevelFunctionElementForLink f = library.getContainedName('f');
+ expect(f.isStatic, true);
+ }
+
+ void test_topLevelGetter_isStatic() {
+ createLinker('get x => null;');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ PropertyAccessorElementForLink_Executable x = library.getContainedName('x');
+ expect(x.isStatic, true);
+ }
+
+ void test_topLevelSetter_isStatic() {
+ createLinker('void set x(value) {}');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ PropertyAccessorElementForLink_Executable x =
+ library.getContainedName('x=');
+ expect(x.isStatic, true);
+ }
+
+ void test_topLevelVariable_isStatic() {
+ createLinker('var x;');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ PropertyAccessorElementForLink_Variable x = library.getContainedName('x');
+ expect(x.isStatic, true);
+ expect(x.variable.isStatic, true);
+ }
+
void test_typeParameter_isTypeParameterInScope_direct() {
createLinker('class C<T, U> {}');
ClassElementForLink_Class c = testLibrary.getContainedName('C');
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698