Files
sdk/pkg/vm/testcases/bytecode/optional_params.dart
T
Alexander Markov 5484b94695 [vm/kernel] Support more operations in bytecode generator
Change-Id: Ie459289196d75fbd69490a0cd4d3d0445e025748
Reviewed-on: https://dart-review.googlesource.com/51800
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-04-23 22:50:21 +00:00

23 lines
587 B
Dart

// Copyright (c) 2018, 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.
void foo1(x, [a = 'default_a', b = 'default_b']) {
print('x = $x');
print('a = $a');
print('b = $b');
}
void foo2(y, z, {c = 'default_c', a = 42, b = const ['default_b']}) {
print('y = $y');
print('z = $z');
print('a = $a');
print('b = $b');
print('c = $c');
}
main() {
foo1('fixed_x', 'concrete_a');
foo2('fixed_y', 'fixed_z', a: 'concrete_a');
}