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

Issue 9160004: Provide better debugging if a null type is encountered. (Closed)

Created:
8 years, 11 months ago by zundel
Modified:
8 years, 11 months ago
Reviewers:
scheglov, codefu
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Provide better debugging if a null type is encountered. Patches up at least one case where the 'this' keyword could return null if used in a static context. http://code.google.com/p/dart/issues/detail?id=761 Committed: https://code.google.com/p/dart/source/detail?r=3564

Patch Set 1 #

Total comments: 7

Patch Set 2 : Incorporated feedback to use fast null check #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -21 lines) Patch
M compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java View 1 17 chunks +64 lines, -17 lines 2 comments Download
M compiler/java/com/google/dart/compiler/type/Types.java View 1 chunk +1 line, -1 line 0 comments Download
M compiler/javatests/com/google/dart/compiler/type/TypeTestCase.java View 3 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
zundel
Issue 761 has a stack trace caused by a null type being returned from somewhere ...
8 years, 11 months ago (2012-01-23 21:25:27 UTC) #1
codefu
lgtm + nits https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (right): https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#newcode621 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:621: extra ws? https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#newcode1331 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:1331: if (type ...
8 years, 11 months ago (2012-01-23 21:48:53 UTC) #2
scheglov
lgtm https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (right): https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#newcode558 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:558: Type argumentType = argumentTypes.next(); assert argumentType != null; ...
8 years, 11 months ago (2012-01-23 21:49:25 UTC) #3
zundel
PTAL https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (right): https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#newcode558 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:558: Type argumentType = argumentTypes.next(); On 2012/01/23 21:49:25, scheglov ...
8 years, 11 months ago (2012-01-23 22:33:35 UTC) #4
scheglov
LGTM http://codereview.chromium.org/9160004/diff/2003/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (right): http://codereview.chromium.org/9160004/diff/2003/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#newcode534 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:534: argumentType.getClass(); no "quick null check" comment http://codereview.chromium.org/9160004/diff/2003/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java#newcode608 compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:608: ...
8 years, 11 months ago (2012-01-24 19:05:02 UTC) #5
codefu
8 years, 11 months ago (2012-01-24 19:08:14 UTC) #6
still LGTM
On 2012/01/23 22:33:35, zundel wrote:
> PTAL
> 
>
https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/googl...
> File compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java (right):
> 
>
https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/googl...
> compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:558: Type
> argumentType = argumentTypes.next();
> On 2012/01/23 21:49:25, scheglov wrote:
> > assert argumentType != null;  ?
> > assert namedEntry.getValue() != null;  ?
> 
> Done.
> 
>
https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/googl...
> compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:579: Type
> argumentType = argumentTypes.next();
> On 2012/01/23 21:49:25, scheglov wrote:
> > assert argumentType != null;  ?
> > Hm... and may be push this line into "else" block.
> I don't think we can move this line because we always need to increment
through
> the iterator.
> 
> I updated the code, but I'm not 100% sure what you meant by move this line.
> 
>
https://chromiumcodereview.appspot.com/9160004/diff/1/compiler/java/com/googl...
> compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java:1331: if (type
==
> null) {
> On 2012/01/23 21:48:53, codefu wrote:
> > What about replacing the other if(null){throw) with:
> > type.getClass(); // Quick null check.
> 
> Done.

Powered by Google App Engine
This is Rietveld 408576698