Commit Graph

200 Commits

Author SHA1 Message Date
zundel@google.com 4e9e3f014f More setting of symbols on identifiers
Konstantin was right in http://codereview.chromium.org/9150044/
I should have included a unit test.  This change includes a
hand written unit test for identifiers being set properly on class/interface
definition variants, and fixes to the ResolverAuditVisitor (it was not
catching many problems in just those cases).

Review URL: https://chromiumcodereview.appspot.com//9138023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3459 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-20 18:19:49 +00:00
codefu@google.com 40edd9ce12 Issue 1233: Parser does not handle position stack correctly in string interpolation
https://code.google.com/p/dart/issues/detail?id=1233
Missing done()
R=messick@google.com
BUG=1233
TEST=

Review URL: https://chromiumcodereview.appspot.com//9254044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3456 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-20 14:55:45 +00:00
zundel@google.com c9e4011585 Record the elements on identifiers in the AST referring to types.
When dartc resolved a type, in the past it did not set the elements for the type
on the AST ( you had to go through the type).  This is a bit tedious in the IDE,
so we are going to try to fill in more of the symbols in the AST.

Review URL: https://chromiumcodereview.appspot.com//9150044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3449 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 21:50:14 +00:00
zundel@google.com bbdbb3791e Protect vs. NPE in TypeAnalyzer.checkInitializedDeclaration()
Stack trace came from user feedback on Dart Editor. See:
http://code.google.com/p/dart/issues/detail?id=759

I wish I could reproduce the original problem, but this guard would be sure to fix it.

Review URL: https://chromiumcodereview.appspot.com//9264022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3447 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 20:54:58 +00:00
codefu@google.com d7b7edd2e0 Issue 1177: Non-existant documentation directory throws
https://code.google.com/p/dart/issues/detail?id=1177
-Just call mkdirs() before creating PrintStream() in DartDocumentationVisitor

R=zundel
BUG=1177
TEST=

Review URL: https://chromiumcodereview.appspot.com//9178038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3446 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 20:11:36 +00:00
zundel@google.com 2f96a3d8b1 Remove support for >>> and >>>= operators in dartc
http://code.google.com/p/dart/issues/detail?id=1166

Review URL: https://chromiumcodereview.appspot.com//9232041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3439 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 18:06:22 +00:00
codefu@google.com fd3c2e8ab3 Issue 986: Static type warning when overriding static super members
http://code.google.com/p/dart/issues/detail?id=986

Truth table:
Super    | static  | instance
Local    |         |
---------+---------+---------
static   | warning | error
instance | warning | warning

Ancillary adition: Warnings are now colored differently from errors to help
distinguish between the two.

R=zundel
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9186037

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3435 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 15:38:29 +00:00
zundel@google.com 6b677ae576 Allow classes shadowed by type variables to be referenced in static context
We still print a shadowing warning, but if there is a valid reference outside
the variable is now resolved to it.  Otherwise, we print the existing message
about not being able to reference type variables in a static context.

See bug: http://code.google.com/p/dart/issues/detail?id=643

Review URL: https://chromiumcodereview.appspot.com//9250017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3434 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 15:12:26 +00:00
mmendez@google.com 2adbd94f14 Revert the revert of http://code.google.com/p/dart/source/detail?r=3360.
Kasper found and fixed the underlying native class code generation bug as part of http://code.google.com/p/dart/source/detail?r=3390.

TBR=kasperl,floitsch

Review URL: https://chromiumcodereview.appspot.com//9255025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3412 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 20:07:49 +00:00
scheglov@google.com 6ad2499dbd Issue 933: Fix for resolving type of Function in field.
http://code.google.com/p/dart/issues/detail?id=933

R=zundel@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9186015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3410 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 19:35:52 +00:00
kasperl@google.com ac0e22f2bc Fix dartc in optimized mode (broken in r3358).
Add checks that ensure that keys used for array access are integers.

Fix bug in the optimization strategy that ended up generating the wrong
code for "native" classes.

R=floitsch@google.com,mmendez@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9250005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3390 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 12:44:47 +00:00
mmendez@google.com 6dfce3cc04 Revert "Remove TypeToken as means for assigning type arguments to arrays."
This reverts commit r3356.  Apparently closure will optimize new Array(x) to Array(void 0).

Review URL: https://chromiumcodereview.appspot.com//9178020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3360 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 15:34:53 +00:00
mmendez@google.com 513d5b44d5 Remove TypeToken as means for assigning type arguments to arrays.
For native, classes with a bodyless constructor, pass the constructor arguments to the native constructor in the generated factory method.  The generated factory method will handle setting the runtime type information if necessary.

Review URL: https://chromiumcodereview.appspot.com//9183002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3356 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 14:55:26 +00:00
codefu@google.com 353443aa53 Issue 1171: Failing to regenerate deleted output js file.
https://code.google.com/p/dart/issues/detail?id=1171

Basically: if no files have changed, check for out of dateness on the build
file to decide on continuing or not.

R=scheglov
BUG=
TEST=

Review URL: http://codereview.chromium.org//9211014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3308 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 20:46:49 +00:00
codefu@google.com d3e882dc53 Issue 1164: Out of date system libraries + restarted compiler
http://code.google.com/p/dart/issues/detail?id=1164

When the compiler fails to complete compilation, and the system libraries are
not bundled, it will fail to recompile the missing elements.  This was only a
problem in the DartEditor and running DartC from an eclipse environment.

Please note that there still exists a condition if you are running DartC
from eclipse and have system libraries, without precompiled artifacts, in a
jar file.  I will file a separate bug for that.

R=mmendez,brianwilkerson@google.com,danrubel
BUG=
TEST=

Review URL: http://codereview.chromium.org//9212008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3301 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 18:40:09 +00:00
scheglov@google.com c5e02bcc0d Issue 1140: Tweak relative path for shadowing problems.
http://code.google.com/p/dart/issues/detail?id=1140

This is only tweak for using dart:// protocol where appropriate.
Specify or not location of shadowed element is debatable question.

R=codefu@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9190044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3241 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-12 16:14:34 +00:00
codefu@google.com a5438ac96e Issue 985: Default class without constructor does not cause a compile-time error
http://code.google.com/p/dart/issues/detail?id=985

R=mmendez,zundel
BUG=
TEST=

Review URL: http://codereview.chromium.org//9168020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3239 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-12 16:06:38 +00:00
scheglov@google.com 146e8ebb82 Issue 965: Report error for static local function
http://code.google.com/p/dart/issues/detail?id=965

R=zundel@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9185013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3198 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-11 18:34:54 +00:00
codefu@google.com 159f4dccf8 Issue 1091: Static type warning for setters with non-void return types
http://code.google.com/p/dart/issues/detail?id=1091
Spec 0.06 section 7.3 Setters

R=zundel
BUG=
TEST=

Review URL: http://codereview.chromium.org//9188004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3196 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-11 17:51:52 +00:00
zundel@google.com 568329fe06 Disallow assignment to a top level method in dartc
http://code.google.com/p/dart/issues/detail?id=966

Review URL: http://codereview.chromium.org//9158014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3154 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 16:39:21 +00:00
codefu@google.com d3703d84e7 Issue 1099: Compile time error for RHS this access in initializer
http://code.google.com/p/dart/issues/detail?id=1099
R=zundel
BUG=1099
TEST=

Review URL: http://codereview.chromium.org//9169013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3153 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 16:31:48 +00:00
codefu@google.com addcaec400 Issue 1105: Duplicate initialization should have a compile error
http://code.google.com/p/dart/issues/detail?id=1105
7.5.1
It is a compile-time error if more than one initializer corresponding to a
given instance variable appears in k’s initializer list. It is a
compile-time error if k’s initializer list contains an initializer for a
variable that is initialized by means of an initializing formal of k.
R=zundel,mmendez
BUG=1105
TEST=

Review URL: http://codereview.chromium.org//9166006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3152 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 16:27:28 +00:00
scheglov@google.com 9eb76b67ca Include dom.dart library into ignoring shadow warnings
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3146 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 15:20:03 +00:00
scheglov@google.com 4c274d4106 Fixes for parsing warnigs, issue 1060.
1. Diet parsing notification fix.

2. Disable name shadow warnings for htmlimpl.dart library, until library itself will be fixed.

3. Fix for identifying core libraries in Editor.

R=zundel@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9149008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3113 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-09 20:33:12 +00:00
codefu@google.com 74015409f2 Issue 988: Compile time error missing for const class / non-final instance variables
http://code.google.com/p/dart/issues/detail?id=988
7.5.3: It is a compile-time error if a constant constructor is declared by a class that has a non-final instance variable.
       The above refers to both locally declared and inherited instance variables.
R=mmendez,zundel
BUG=
TEST=

Review URL: http://codereview.chromium.org//9122015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3108 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-09 17:58:08 +00:00
zundel@google.com 69b567e798 in dartc, generics in Typedef not working as expected, when extending generic type
http://code.google.com/p/dart/issues/detail?id=436

Review URL: http://codereview.chromium.org//9049016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3103 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-09 17:06:37 +00:00
scheglov@google.com 01abdc883f Blacklist types from core library, issue 969
http://code.google.com/p/dart/issues/detail?id=969

R=zundel@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9124006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3102 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-09 16:36:04 +00:00
mmendez@google.com 34b6799f7c Fix http://code.google.com/p/dart/issues/detail?id=990.
Need to check that the implicit super call resolves.  Updated the unit tests until the c019 tests are refreshed.

Review URL: http://codereview.chromium.org//9139001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3098 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-09 15:35:16 +00:00
brianwilkerson@google.com 8fcfbe459a Fix so that listeners will get notified. Sorry I missed this when reviewing the change.
Review URL: http://codereview.chromium.org//9124018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3073 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-07 15:54:00 +00:00
codefu@google.com 2726b1e229 Issue 1061: Duplicate members causes NPE in type analyzer
http://code.google.com/p/dart/issues/detail?id=1061
Replace Map<Element> with MultiMap<Element> (LinkedHashMap).
R=zundel,messick
BUG=1061
TEST=

Review URL: http://codereview.chromium.org//9122003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3047 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-06 18:32:20 +00:00
scheglov@google.com bf920d8dfd Add unitAboutToCompile() into DartCompilerListener
R=brianwilkerson@google.com,codefu@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9113017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3045 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-06 16:34:20 +00:00
devoncarew@google.com e7469aa059 Fix for an NPE for cases where the native keyword on a class is not followed by a string identifier.
Review URL: http://codereview.chromium.org//9109019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3011 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 21:08:30 +00:00
scheglov@google.com 4bcedc935b Convert "library unit" File path into "absolute unit path", issue 590.
http://code.google.com/p/dart/issues/detail?id=590

Actually URI is not expectedto be absolute path to the unit, this is just ID.
And Compiler provides it in form pathToTheLibraryUnit/unitName.dart
So, I've tweaked converting URI into File.

R=brianwilkerson@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8898001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3002 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 16:05:32 +00:00
scheglov@google.com 0c8e0d803d Report error for interface method with body
http://code.google.com/p/dart/issues/detail?id=971

R=zundel@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9086015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3000 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-05 15:48:06 +00:00
codefu@google.com 7360b44dac Issue 1043: Missing --documentation-out should default to "out" instead of asserting
http://code.google.com/p/dart/issues/detail?id=1043

R=zundel
BUG=
TEST=

Review URL: http://codereview.chromium.org//9094001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2965 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-04 20:16:55 +00:00
codefu@google.com dbb10e2cc8 Issue 1039: Nested comments
http://code.google.com/p/dart/issues/detail?id=1039

Language Specification 0.06, 14.1.2 specifices that multiline comments can
nest:
  MULTI LINE COMMENT:
    ‘/*’ (MULTI LINE COMMENT |  ̃ ‘*/’)* ‘*/’
  ;

R=zundel
BUG=1039
TEST=

Review URL: http://codereview.chromium.org//9030028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2964 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-04 19:59:21 +00:00
zundel@google.com eb007b203c Fix dartc bounds checking for invoking interface constructors/factory methods
http://code.google.com/p/dart/issues/detail?id=943

Review URL: http://codereview.chromium.org//9014029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2957 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-04 18:24:50 +00:00
zundel@google.com 9c6d9fc4de Flag methods as not being valid compile time constants
BUG=1000
TEST=

Review URL: http://codereview.chromium.org//9016050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2956 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-04 18:19:34 +00:00
codefu@google.com d5dbe92233 Issue 991: Missing compiler errors for uninitialized final fields
http://code.google.com/p/dart/issues/detail?id=991
  -Track non initialized fields at declaration for classes
  -Verify they are initialized in non-redirect constructors
  -Check for duplicate final initialization; add tests and mark VM and Frog
   as failing
BUG=
TEST=

Review URL: http://codereview.chromium.org//9081001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2951 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-04 16:51:55 +00:00
zundel@google.com e215e81abc Violating type bounds on a new invocation is a static type error, not a compile error
http://code.google.com/p/dart/issues/detail?id=1027

Review URL: http://codereview.chromium.org//9016053

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2921 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-03 20:53:39 +00:00
codefu@google.com 5ed64c70d9 Issue 940 - Exception generating js for prefixed toplevel fields
http://code.google.com/p/dart/issues/detail?id=940

Talked to Gilad about the abiguity of language spec between prefix identifiers and method invocation. P.id(...) looks like o.m(...) to the parser at the moment.
Local fields are correctly represented in the AST as unqualified invocations.

R=zundel,mmendez
BUG=
TEST=

Review URL: http://codereview.chromium.org//8956062

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2910 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-03 15:04:28 +00:00
codefu@google.com b07eeae6d3 Issue 999: NPE from CompileTimeConstantAnalyzer
http://code.google.com/p/dart/issues/detail?id=999

R=scheglov@google.com,zundel@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9052002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2876 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-29 20:14:27 +00:00
scheglov@google.com 66edafb3ab Check for abstract method with body and top-level abstract elements, issue 871
http://code.google.com/p/dart/issues/detail?id=871

R=codefu@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9015002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2867 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-29 16:11:19 +00:00
codefu@google.com e480e8e7fc Issue926: NPE while traversing nodes + invalid string interpolation
http://code.google.com/p/dart/issues/detail?id=926

BUG=
TEST=

Review URL: http://codereview.chromium.org//9006033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2866 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-29 13:51:26 +00:00
zundel@google.com 27f2e70854 This adds a unit test to show the type checking functionality missing in dartc
This refines omitting the runtime-type checks in certain cases to just apply to
type variables (original disabled by r2660)

BUG=925
TEST=

Review URL: http://codereview.chromium.org//8956047

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2771 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 17:45:45 +00:00
codefu@google.com b2605b7590 Issue 250: Allow for GNU formatted errors
Removes --machine-problems option and added --error_format [normal|machine|gnu]

R=zundel@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//8949055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2763 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 15:39:57 +00:00
codefu@google.com 8d6ffa5af8 Issue 895: NPEs in DeltaAnalyser
When copying old elements in the DeltaAnalyser, skip the members that don't
  have nodes.
  When called with null parameters from the completion engine, just return.
BUG=
TEST=

Review URL: http://codereview.chromium.org//9004032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2762 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 15:33:34 +00:00
zundel@google.com bc620b97a8 Moves over remaining .dart code references to 'factory' in interface declartions to 'default'
BUG=
TEST=

Review URL: http://codereview.chromium.org//9016026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2752 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 13:35:54 +00:00
zundel@google.com b0348a06b7 Dartc was not raising an error if an interface declared constructors without a default clause
BUG=928
TEST=

Review URL: http://codereview.chromium.org//9017015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2716 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-21 19:05:54 +00:00
zundel@google.com b9cf172e4a Workaround for referencing type args in the $named_$lookupRTT method.
These lookup methods references $typeArgs as if they were a parameter to the method,
but that method actually takes no arguments.  There is no 'this' context either, but
at least JS compiler doesn't complain about that.

BUG=
TEST=

Review URL: http://codereview.chromium.org//9006012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2660 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-20 19:58:50 +00:00