2949c787a6
Main modification in compile_time_constants.dart cps_ir/const_expression.dart cps_ir/cps_ir_builder.dart R=efortuna@google.com, sigurdm@google.com Committed: https://code.google.com/p/dart/source/detail?r=40372 Review URL: https://codereview.chromium.org//574683002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40759 260f80e4-7a28-3924-810f-c04153c831b5
66 lines
1.5 KiB
Dart
66 lines
1.5 KiB
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 test_lib;
|
|
|
|
import 'test_lib_foo.dart';
|
|
import 'test_lib_bar.dart';
|
|
export 'test_lib_foo.dart';
|
|
export 'test_lib_bar.dart';
|
|
|
|
/**
|
|
* Doc comment for class [A].
|
|
*
|
|
* Multiline Test
|
|
*/
|
|
/*
|
|
* Normal comment for class A.
|
|
*/
|
|
class A {
|
|
|
|
int _someNumber;
|
|
|
|
A() {
|
|
_someNumber = 12;
|
|
}
|
|
|
|
A.customConstructor();
|
|
|
|
/**
|
|
* Test for linking to parameter [A]
|
|
*/
|
|
void doThis(int A) {
|
|
print(A);
|
|
}
|
|
}
|
|
|
|
// A trivial use of `B` and `C` to eliminate import warnings
|
|
B sampleMethod(C cInstance) {
|
|
throw new UnimplementedError();
|
|
}
|
|
|
|
int positionalDefaultValues([
|
|
int intConst = 42,
|
|
bool boolConst = true,
|
|
List listConst = const [true, 42, 'Shanna', null, 3.14, const []],
|
|
String stringConst = 'Shanna',
|
|
Map mapConst = const {'a':1, 2: true, 'c': const [1,null,true]},
|
|
Map emptyMap = const {},
|
|
int referencedConst = INT_CONST,
|
|
ConstClass constructedConstant1 = const ConstClass<int>(0, true),
|
|
ConstClass constructedConstant2 = const ConstClass(1, false, str: "str")]) {
|
|
throw new UnimplementedError();
|
|
}
|
|
|
|
const int INT_CONST = 42;
|
|
|
|
class ConstClass<T> {
|
|
final bool boolField;
|
|
final int intField;
|
|
final String stringField;
|
|
|
|
const ConstClass(this.intField, this.boolField, {String str: 'default'})
|
|
: this.stringField = str;
|
|
}
|