Skip to content

Commit

Permalink
fix #549 export of properties
Browse files Browse the repository at this point in the history
R=vsm@google.com

Review URL: https://codereview.chromium.org/1949253002 .
  • Loading branch information
John Messerly committed May 4, 2016
1 parent c840252 commit 56b9d09
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/dev_compiler/lib/src/compiler/code_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,12 @@ class CodeGenerator extends GeneralizingAstVisitor
// Don't allow redefining names from this library.
if (currentNames.containsKey(export.name)) continue;

_loader.emitDeclaration(export);
if (export.isSynthetic && export is PropertyInducingElement) {
_loader.emitDeclaration(export.getter);
_loader.emitDeclaration(export.setter);
} else {
_loader.emitDeclaration(export);
}
if (export is ClassElement && export.typeParameters.isNotEmpty) {
// Export the generic name as well.
// TODO(jmesserly): revisit generic classes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
// BSD-style license that can be found in the LICENSE file.

export 'export_order_test.dart';
export 'export_order_helper2.dart' show z;
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ import 'export_order_helper1.dart';
class Info {
int x = y;
}

int get z => 38;
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ final info = new Info();
void main() {
Expect.equals(38, info.x);
Expect.equals(38, bar.y);
Expect.equals(38, bar.z);
}

0 comments on commit 56b9d09

Please sign in to comment.