mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 22:01:19 +00:00
cf906beba3
When deferred static functions go to a different output hunk than the class they are defined in the emitter got problems with outputting them. We could say that static functions always go to the same output-unit as their class, and this is needed to support reflection. But we already handle it that way when reflection is needed. In deferred_load.dart: void addLiveInstanceMember(Element element) { if (!compiler.enqueuer.resolution.hasBeenResolved(element)) return; if (!isMirrorUsage && !element.isInstanceMember) return; collectDependencies(element.implementation); } R=floitsch@google.com Review URL: https://codereview.chromium.org//810473003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42389 260f80e4-7a28-3924-810f-c04153c831b5
51 lines
997 B
Dart
51 lines
997 B
Dart
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
library lib1;
|
|
|
|
class ConstClass {
|
|
final x;
|
|
const ConstClass(this.x);
|
|
}
|
|
|
|
var x = const ConstClass(const ConstClass(1));
|
|
|
|
class C {
|
|
static foo() {
|
|
() {} (); // Hack to avoid inlining.
|
|
return 1;
|
|
}
|
|
bar() {
|
|
() {} (); // Hack to avoid inlining.
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
class C1 {
|
|
static var foo = const {};
|
|
var bar = const {};
|
|
}
|
|
|
|
class C2 {
|
|
static var foo = new Map.from({1: 2});
|
|
var bar = new Map.from({1: 2});
|
|
}
|
|
|
|
class C3 {
|
|
static final foo = const ConstClass(const ConstClass(1));
|
|
final bar = const ConstClass(const ConstClass(1));
|
|
}
|
|
|
|
class C4 {
|
|
static final foo = new Map.from({x: x});
|
|
final bar = new Map.from({x: x});
|
|
}
|
|
|
|
class C5 {
|
|
static const foo = const [const {1: 3}];
|
|
bar() {
|
|
() {} (); // Hack to avoid inlining.
|
|
return 1;
|
|
}
|
|
} |