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

Issue 10908143: Support check mode for statics. (Closed)

Created:
8 years, 3 months ago by ngeoffray
Modified:
8 years, 3 months ago
Reviewers:
karlklose, floitsch, ahe, kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Support check mode for statics. Committed: https://code.google.com/p/dart/source/detail?r=12187

Patch Set 1 : #

Total comments: 1

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -13 lines) Patch
M lib/compiler/implementation/compile_time_constants.dart View 1 2 3 chunks +20 lines, -3 lines 0 comments Download
M lib/compiler/implementation/constants.dart View 1 8 chunks +28 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 chunks +4 lines, -1 line 0 comments Download
M lib/compiler/implementation/typechecker.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M tests/co19/co19-dart2js.status View 1 1 chunk +0 lines, -2 lines 0 comments Download
A tests/language/compile_time_constant_checked_test.dart View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M tests/language/language_dart2js.status View 1 2 3 chunks +4 lines, -3 lines 0 comments Download
M tests/language/static_initializer_type_error_test.dart View 1 2 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
ngeoffray
8 years, 3 months ago (2012-09-07 15:11:13 UTC) #1
floitsch
I'm still not convinced that this is the right way to go forward, but otherwise ...
8 years, 3 months ago (2012-09-10 09:26:51 UTC) #2
kasperl
LGTM. Do you think the test coverage for the areas Florian mentions is good enough? ...
8 years, 3 months ago (2012-09-10 13:34:13 UTC) #3
ngeoffray
PTAL. I have changed the code to get a compile-time error on final and const ...
8 years, 3 months ago (2012-09-11 10:54:23 UTC) #4
ngeoffray
+karl, +peter
8 years, 3 months ago (2012-09-11 10:58:27 UTC) #5
kasperl
https://chromiumcodereview.appspot.com/10908143/diff/6001/tests/language/static_initializer_type_error_test.dart File tests/language/static_initializer_type_error_test.dart (right): https://chromiumcodereview.appspot.com/10908143/diff/6001/tests/language/static_initializer_type_error_test.dart#newcode8 tests/language/static_initializer_type_error_test.dart:8: bool inCheckedMode = false; Wouldn't it be cleaner to ...
8 years, 3 months ago (2012-09-11 11:04:22 UTC) #6
kasperl
Even better: if (inCheckedMode()) { Expect.throws(() => x, (e) => e is XXXException); Expect.isNull(x); }
8 years, 3 months ago (2012-09-11 11:05:52 UTC) #7
kasperl
LGTM. It would be nice with a test case that checks that we get the ...
8 years, 3 months ago (2012-09-11 11:07:17 UTC) #8
ngeoffray
8 years, 3 months ago (2012-09-11 11:57:31 UTC) #9
Thanks Kasper

Test added for what this change covers. I'll work on the other cases Florian
mentions in another CL.

https://chromiumcodereview.appspot.com/10908143/diff/6001/tests/language/stat...
File tests/language/static_initializer_type_error_test.dart (right):

https://chromiumcodereview.appspot.com/10908143/diff/6001/tests/language/stat...
tests/language/static_initializer_type_error_test.dart:8: bool inCheckedMode =
false;
On 2012/09/11 11:04:23, kasperl wrote:
> Wouldn't it be cleaner to compute if we're in checked mode with a different
> (simpler) method and then do something like:
> 
>    main() {
>      if (inCheckedMode()) {
>        Expect.throws(() => x, (e) => e is XXXException);
>      } else {
>        Expect.equals("milou", x);
>      }
>    }
> 
>    bool inCheckedMode() {
>     int x; 
>     try {
>        x = true;
>      } catch (e) {
>        return true;
>      }
>      return false;
>    }

I'd like not to change the test so much, and the test is mostly about line 16,
making sure we do not throw exception a second time.

I believe other tests use your "inCheckedMode()" trick for detecting ordinary
dynamic type error.

Powered by Google App Engine
This is Rietveld 408576698