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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java

Issue 8954016: Don't allow new of interface without constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 | « compiler/java/com/google/dart/compiler/resolver/Elements.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
index 5ce4d3691657b0bc64b0cee307bb1852e9d23007..c805912292fa821c0f636b8b515d0a98ae216503 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java
@@ -217,6 +217,19 @@ public class ResolverTest extends ResolverTestCase {
*/
}
+ public void testImplicitDefaultConstructor_OnInterfaceWithoutFactory() {
+ // Check that the implicit constructor is resolved correctly
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "interface B {}",
+ "class C { main() { new B(); } }"),
+ ResolverErrorCode.NEW_EXPRESSION_NOT_CONSTRUCTOR);
+
+ /*
+ * We should check for signature mismatch but that is a TypeAnalyzer issue.
+ */
+ }
+
public void testImplicitDefaultConstructor_ThroughFactories() {
// Check that we generate implicit constructors through factories also.
resolveAndTest(Joiner.on("\n").join(
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/Elements.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698