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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 10520019: Issue 3271. Top-level function 'main' should not have parameters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index ac090626ba4e591e74a0b17e466ba71c365a8b19..7f657d5cd22c5803573eaa3aacac960ac4a965e0 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -53,6 +53,25 @@ import java.util.List;
* slower, not actually unit test, but easier to use if you need access to DartNode's.
*/
public class TypeAnalyzerCompilerTest extends CompilerTestCase {
+
+ /**
+ * Top-level "main" function should not have parameters.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=3271
+ */
+ public void test_topLevelMainFunction() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "main(var p) {}",
+ "class A {",
+ " main(var p) {}",
+ "}",
+ "");
+ assertErrors(
+ libraryResult.getErrors(),
+ errEx(ResolverErrorCode.MAIN_FUNCTION_PARAMETERS, 2, 1, 4));
+ }
+
/**
* Tests that we correctly provide {@link Element#getEnclosingElement()} for method of class.
*/

Powered by Google App Engine
This is Rietveld 408576698