DescriptionPut 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]. #Messages
Total messages: 8 (0 generated)
|