|
Rewrite how we handle synthesized constructors in the compiler. This was motivated by issue https://code.google.com/p/dart/issues/detail?id=11822.
This change:
- Removes the need to create synthesized nodes for the default constructor.
- Treats the default constructor and forwarding constructors in mixins uniformaly: they both are synthesized constructors that call a super constructor.
- Makes the compiler aware that some elements may not have nodes, and acts accordingly. Before, the default constructor had a synthesized node, so the compiler was happy with it. And the forwarding constructors were handled specially to just skip to a non-synthesized constructor. The latter behavior was the cause of issue 11822, and type inference problems.
- Makes the resolver implement what is specified in the specification for forwarding constructors: we create one synthesized constructor per generative constructor of the super class.
- Implements forwarding constructor in named (aka typedef) mixin applications. See builder.dart, and mixin_typedef_constructor_test.dart
- Implements const classes in the presence of mixins: tests/language/const_constructor_mixin_test.dart.
- Fixes type inference in the presence of forwarding constructors: tests/language/inference_mixin_field_test.dart.
R=ahe@google.com, karlklose@google.com
Committed: https://code.google.com/p/dart/source/detail?r=25148
Total comments: 18
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+408 lines, -194 lines) |
Patch |
|
M |
sdk/lib/_internal/compiler/implementation/closure.dart
|
View
|
1
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
|
View
|
1
|
8 chunks |
+28 lines, -22 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/compiler.dart
|
View
|
1
2
3
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/deferred_load.dart
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/elements/elements.dart
|
View
|
1
|
1 chunk |
+1 line, -5 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
View
|
1
|
2 chunks |
+15 lines, -54 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/enqueue.dart
|
View
|
1
|
1 chunk |
+0 lines, -6 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/resolution/members.dart
|
View
|
1
2
3
4
|
5 chunks |
+33 lines, -18 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
View
|
1
|
13 chunks |
+68 lines, -67 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
|
View
|
1
2
3
|
1 chunk |
+15 lines, -8 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
|
View
|
1
|
2 chunks |
+10 lines, -7 lines |
0 comments
|
Download
|
|
M |
sdk/lib/_internal/compiler/implementation/universe/universe.dart
|
View
|
1
|
2 chunks |
+74 lines, -1 line |
0 comments
|
Download
|
|
M |
tests/compiler/dart2js/mock_compiler.dart
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
tests/language/const_constructor_mixin_test.dart
|
View
|
|
1 chunk |
+18 lines, -0 lines |
0 comments
|
Download
|
|
A |
tests/language/inference_mixin_field_test.dart
|
View
|
|
1 chunk |
+28 lines, -0 lines |
0 comments
|
Download
|
|
A |
tests/language/mixin_forwarding_constructor1_test.dart
|
View
|
|
1 chunk |
+31 lines, -0 lines |
0 comments
|
Download
|
|
A |
tests/language/mixin_forwarding_constructor2_test.dart
|
View
|
|
1 chunk |
+30 lines, -0 lines |
0 comments
|
Download
|
|
A |
tests/language/mixin_typedef_constructor_test.dart
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
A |
tests/language/mixin_with_two_implicit_constructors_test.dart
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
M |
tests/utils/dummy_compiler_test.dart
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
tests/utils/recursive_import_test.dart
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 8 (0 generated)
|