Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings from static analysis when compiling dart2js core libraries #2142

Closed
DartBot opened this issue Mar 14, 2012 · 8 comments
Closed

Warnings from static analysis when compiling dart2js core libraries #2142

DartBot opened this issue Mar 14, 2012 · 8 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant

Comments

@DartBot
Copy link

DartBot commented Mar 14, 2012

This issue was originally filed by zundel@google.com


See also https://chromiumcodereview.appspot.com/9704006/ for 2 fatal errors I encountered.

WARNING|STATIC_TYPE|VOID|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/core/core_frog.dart/core_frog.dart|99|43|1|expression does not yield a value
    98: TypeError._internal(Object src, String dstType)
    99: : super._internal("TypeError", null, -1, -1) native @­'''
                                                  ~
WARNING|STATIC_TYPE|VOID|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/core/core_frog.dart/core_frog.dart|99|47|1|expression does not yield a value
    98: TypeError._internal(Object src, String dstType)
    99: : super._internal("TypeError", null, -1, -1) native @­'''
                                                      ~
WARNING|STATIC_TYPE|DEFAULT_CONSTRUCTOR_TYPES|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/core/core_frog.dart/frog/date.dart|51|3|27|Constructor 'Date.withTimeZone' in 'Date' has parameters types (int,int,int,int,int,int,int,TimeZone), doesn't match 'DateImplementation.withTimeZone' in 'DateImplementation' with (int,int,int,int,int,int,int,TimeZoneImplementation)
    50: */
    51: Date.withTimeZone(int year,
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
WARNING|STATIC_TYPE|DEFAULT_CONSTRUCTOR_TYPES|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/core/core_frog.dart/frog/date.dart|81|3|51|Constructor 'Date.fromEpoch' in 'Date' has parameters types (int,TimeZone), doesn't match 'DateImplementation.fromEpoch' in 'DateImplementation' with (<dynamic>,<dynamic>)
    80: */
    81: const Date.fromEpoch(int value, TimeZone timeZone);
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|69|35|6|Parameter 'length' is hiding 'FIELD length' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:ListFactory:49:7
    68:
    69: List<E> getRange(int start, int length) native """
                                          ~~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|78|32|6|Parameter 'length' is hiding 'FIELD length' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:ListFactory:49:7
    77:
    78: void setRange(int start, int length, List<E> from, [int startFrom = 0]) {
                                       ~~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|97|35|6|Parameter 'length' is hiding 'FIELD length' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:ListFactory:49:7
    96:
    97: void removeRange(int start, int length) native """
                                          ~~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|106|35|6|Parameter 'length' is hiding 'FIELD length' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:ListFactory:49:7
   105:
   106: void insertRange(int start, int length, [E initialValue]) native """
                                          ~~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|361|20|5|Parameter 'group' is hiding 'METHOD group' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:MatchImplementation:361:10
   360: int end() => _end;
   361: String group(int group) => _groups[group];
                           ~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|362|26|5|Parameter 'group' is hiding 'METHOD group' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:MatchImplementation:361:10
   361: String group(int group) => _groups[group];
   362: String operator [](int group) => _groups[group];
                                 ~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|365|33|6|Parameter 'groups' is hiding 'METHOD groups' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:MatchImplementation:365:16
   364:
   365: List<String> groups(List<int> groups) {
                                        ~~~~~~
WARNING|RESOLVER|DUPLICATE_PARAMETER_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|367|25|5|Parameter 'group' is hiding 'METHOD group' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:MatchImplementation:361:10
   366: List<String> out = [];
   367: groups.forEach((int group) => out.add(_groups[group]));
                                ~~~~~
WARNING|RESOLVER|DUPLICATE_LOCAL_VARIABLE_WARNING|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/coreimpl_frog.dart|396|9|4|Local variable 'next' is hiding 'METHOD next' at dart://core/home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart:_AllMatchesIterator:390:9
   395: // _next is set by #hasNext
   396: var next = _next;
                ~~~~
WARNING|STATIC_TYPE|ABSTRACT_CLASS_WITHOUT_ABSTRACT_MODIFIER|dart://core//home/zundel/dart/out/Debug_ia32/dart-sdk/lib/coreimpl/coreimpl_frog.dart/frog/string_implementation.dart|10|7|20|StringImplementation is an abstract class because it does not implement the inherited abstract members:
    # From Pattern:
        Iterable<Match> allMatches(String)
     9: // TODO(jimhug): Unify with code from compiler/lib/implementation.
    10: class StringImplementation implements String native "String" {
              ~~~~~~~~~~~~~~~~~~~~

@kasperl
Copy link

kasperl commented Mar 16, 2012

Florian, could you take a look at this? I guess it's mostly a matter of some simple renaming.


Set owner to @floitschG.
Added Accepted label.

@floitschG
Copy link
Contributor

How to reproduce:
create a small dart file:
===
$ cat /tmp/frog.dart
#import("dart:html");
#import("dart:core");
#import("dart:coreimpl");
#import("dart:dom", prefix: 'dom');
#import("dart:json");
#import("dart:isolate", prefix: 'isolate');
#import("dart:uri");
#import("dart:utf");
===
run dartc on it:
out/Release_ia32/compiler/bin/dartc --show-sdk-warnings --platform "frog" /tmp/frog.dart

@floitschG
Copy link
Contributor

I have fixed a lot of the warnings: r6119

There are still tons of warnings left where (I think) the HTML library overrides static variables in sub-classes.
Jacob, could you have a look at this?


Set owner to @jacob314.
Added Triaged label.

@anders-sandholm
Copy link
Contributor

Removed Area-Frog label.
Added Area-Dart2JS, OldAreaFrog labels.

@anders-sandholm
Copy link
Contributor

Removed OldAreaFrog label.
Added FromAreaFrog label.

@kasperl
Copy link

kasperl commented Jun 12, 2012

Looks like the remaining issues are in the DOM library.


Removed Area-Dart2JS, FromAreaFrog labels.
Added Area-DOM label.
Changed the title to: "Warnings from static analysis when compiling dart2js core libraries".

@DartBot
Copy link
Author

DartBot commented Jun 15, 2012

This comment was originally written by zundel@google.com


Updated instructions:

if your build environment is setup from all.deps and you are building the command line with:

 ./tools/build.py -m release

you should have the analyzer command line tool under out/ReleaseIA32/analyzer/bin/dart_analzyer

Here is a retelling of issue #2142 brought up to date:

How to reproduce:
create a small dart file that includes all the libraries you want to test:
===
$ cat > /tmp/alllibs.dart <<EOT
#import("dart:html");
#import("dart:core");
#import("dart:coreimpl");
#import("dart:json");
#import("dart:isolate", prefix: 'isolate');
#import("dart:uri");
#import("dart:utf");
EOT

===
To run analysis:
out/ReleaseIA32/analyzer/bin/dart_analyzer --show-sdk-warnings --platform "dart2js" /tmp/alllibs.dart

The different configurations for the 'platform' argument come from lib/config/import_
*.config

@vsmenon
Copy link
Member

vsmenon commented Jul 12, 2012

I think these issues are now fixed. I cannot run the instructions above though. I get:

./xcodebuild/ReleaseIA32/analyzer/bin/dart_analyzer --show-sdk-warnings --platform "dart2js" zundel.dart
com.google.dart.compiler.InternalCompilerException: Can't find system library dart:dart:core at /Users/vsm/git/dart/dart/xcodebuild/ReleaseIA32/dart-sdk/lib/core/core_frog.dart
    at com.google.dart.compiler.SystemLibraryManager.getDefaultLibraries(SystemLibraryManager.java:347)
    at com.google.dart.compiler.SystemLibraryManager.<init>(SystemLibraryManager.java:106)
    at com.google.dart.compiler.DefaultCompilerConfiguration.<init>(DefaultCompilerConfiguration.java:41)
    at com.google.dart.compiler.DartCompiler.compilerMain(DartCompiler.java:1029)
    at com.google.dart.compiler.DartCompiler.main(DartCompiler.java:996)


Added AssumedStale label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant
Projects
None yet
Development

No branches or pull requests

6 participants