Skip to content

Commit 56b9d09

Browse files
author
John Messerly
committed
1 parent c840252 commit 56b9d09

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

pkg/dev_compiler/lib/src/compiler/code_generator.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,12 @@ class CodeGenerator extends GeneralizingAstVisitor
416416
// Don't allow redefining names from this library.
417417
if (currentNames.containsKey(export.name)) continue;
418418

419-
_loader.emitDeclaration(export);
419+
if (export.isSynthetic && export is PropertyInducingElement) {
420+
_loader.emitDeclaration(export.getter);
421+
_loader.emitDeclaration(export.setter);
422+
} else {
423+
_loader.emitDeclaration(export);
424+
}
420425
if (export is ClassElement && export.typeParameters.isNotEmpty) {
421426
// Export the generic name as well.
422427
// TODO(jmesserly): revisit generic classes

pkg/dev_compiler/test/codegen/language/export_order_helper1.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
export 'export_order_test.dart';
6+
export 'export_order_helper2.dart' show z;

pkg/dev_compiler/test/codegen/language/export_order_helper2.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ import 'export_order_helper1.dart';
77
class Info {
88
int x = y;
99
}
10+
11+
int get z => 38;

pkg/dev_compiler/test/codegen/language/export_order_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ final info = new Info();
1212
void main() {
1313
Expect.equals(38, info.x);
1414
Expect.equals(38, bar.y);
15+
Expect.equals(38, bar.z);
1516
}

0 commit comments

Comments
 (0)