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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/TestTypeProvider.java

Issue 22872008: Analyzer: Don't allow extending or implementing Null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update expectations. Still fail on "with Null". Created 7 years, 4 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/TestTypeProvider.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/TestTypeProvider.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/TestTypeProvider.java
index cf0957dbd2e9d6543c2b487034a574a12d521f8a..e4e79ad067558719724d87fec691478a4ac65a49 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/TestTypeProvider.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/resolver/TestTypeProvider.java
@@ -1,11 +1,11 @@
/*
* Copyright (c) 2013, the Dart project authors.
- *
+ *
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
- *
+ *
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
@@ -89,6 +89,11 @@ public class TestTypeProvider implements TypeProvider {
private InterfaceType mapType;
/**
+ * The type representing the built-in type 'Null'.
+ */
+ private InterfaceType nullType;
+
+ /**
* The type representing the built-in type 'num'.
*/
private InterfaceType numType;
@@ -236,6 +241,14 @@ public class TestTypeProvider implements TypeProvider {
}
@Override
+ public InterfaceType getNullType() {
+ if (nullType == null) {
+ nullType = classElement("Null").getType();
+ }
+ return nullType;
+ }
+
+ @Override
public InterfaceType getNumType() {
if (numType == null) {
initializeNumericTypes();
@@ -387,7 +400,7 @@ public class TestTypeProvider implements TypeProvider {
/**
* Given a class element representing a class with type parameters, propagate those type
* parameters to all of the accessors, methods and constructors defined for the class.
- *
+ *
* @param classElement the element representing the class with type parameters
*/
private void propagateTypeArguments(ClassElementImpl classElement) {

Powered by Google App Engine
This is Rietveld 408576698