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

Issue 592923002: Put union types behind a flag. (Closed)

Created:
6 years, 3 months ago by Nathan Collins
Modified:
6 years, 3 months ago
Reviewers:
jwren, Brian Wilkerson
CC:
reviews_dartlang.org, ricow1
Visibility:
Public.

Description

Put union types behind a flag. I added two union types related flags: - enableUnionTypes: whether or not union types should be used. - strictUnionTypes: whether or not union types should have "strict" semantics. The default, non-strict semantics are more like intersection types: they're less sound than the strict semantics but generate fewer warnings, by saying e.g. that a method is defined on the union if it's defined on *any* of the members. For the strict semantics we want the method to be defined on *all* the members. I surfaced the flags in the static [AnalysisEngine] instance and added a helper function for setting them in the resolver tests. The next step is to use the "strict" flag to implement the optional strict semantics for union types. I don't know where setting the options for the Dart Editor is documented, so I'm summarizing @brianwilkerson's instructions here. In Eclipse, assuming you already have a Dart Editor configuration, do run configurations -> launch dart editor -> tracing -> enable tracing -> enable com.google.dart.tools.core -> enable experimental/enableUnionTypes and (optionally) enable experimental/strictUnionTypes R=brianwilkerson@google.com, jwren@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=40635

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use union types [AnalysisOptions] in [ResolverVisitor] and tests. #

Total comments: 2

Patch Set 3 : Make union-type options available in [AnalysisEngine]. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -7 lines) Patch
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/AnalysisEngine.java View 1 2 4 chunks +50 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java View 1 2 2 chunks +10 lines, -7 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/HintCodeTest.java View 1 3 chunks +3 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/NonHintCodeTest.java View 1 1 chunk +1 line, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/ResolverTestCase.java View 1 2 3 chunks +15 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticTypeWarningCodeTest.java View 1 1 chunk +1 line, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/TypePropagationTest.java View 1 2 chunks +2 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/.options View 1 chunk +2 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/DartCoreDebug.java View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/analysis/model/ProjectImpl.java View 1 2 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Nathan Collins
6 years, 3 months ago (2014-09-23 01:01:46 UTC) #1
Brian Wilkerson
https://codereview.chromium.org/592923002/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java File editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java (right): https://codereview.chromium.org/592923002/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java#newcode733 editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java:733: // dependencies. You need to access the option from ...
6 years, 3 months ago (2014-09-23 13:49:08 UTC) #2
Nathan Collins
https://codereview.chromium.org/592923002/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java File editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java (right): https://codereview.chromium.org/592923002/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java#newcode733 editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java:733: // dependencies. On 2014/09/23 13:49:08, Brian Wilkerson wrote: > ...
6 years, 3 months ago (2014-09-23 21:07:21 UTC) #3
Nathan Collins
PTAL.
6 years, 3 months ago (2014-09-23 21:12:46 UTC) #4
Brian Wilkerson
LGTM https://codereview.chromium.org/592923002/diff/20001/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java File editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java (right): https://codereview.chromium.org/592923002/diff/20001/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java#newcode742 editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ResolverVisitor.java:742: // TODO(collinsn): If I import this class then ...
6 years, 3 months ago (2014-09-23 22:04:51 UTC) #5
Nathan Collins
PTAL. I removed the union type options from [AnalysisOptions] and surfaced them in [AnalysisEngine] instead, ...
6 years, 3 months ago (2014-09-24 00:34:06 UTC) #6
Brian Wilkerson
LGTM
6 years, 3 months ago (2014-09-24 13:28:43 UTC) #7
Nathan Collins
6 years, 3 months ago (2014-09-24 17:31:47 UTC) #8
Message was sent while issue was closed.
Committed patchset #3 manually as 40635 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698