Files
sdk/pkg/front_end/testcases/const_functions/const_functions_block.dart.weak.expect
T
Kallen Tu 3210fb4306 [cfe] Environment parents and block tests for const functions.
Fixed up block environment and added tests for them.

Change-Id: I97375c90c9244f6dcf8294dc11b0d4e70697d114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190320
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-10 15:23:18 +00:00

44 lines
797 B
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
import "package:expect/expect.dart";
static method blockTest() → void {
function x() → core::int
return 1;
exp::Expect::equals(#C1, 1);
{
function x() → core::int
return 2;
exp::Expect::equals(#C2, 2);
{
function x() → core::int
return 3;
exp::Expect::equals(#C3, 3);
}
}
exp::Expect::equals(#C1, 1);
}
static method blockTest1() → void {
function x() → core::int {
core::int z = 3;
{
core::int z = 4;
}
return z;
}
exp::Expect::equals(#C3, 3);
}
static method main() → void {
self::blockTest();
self::blockTest1();
}
constants {
#C1 = 1
#C2 = 2
#C3 = 3
}