Skip to content

Commit ead8b7f

Browse files
jakemac53commit-bot@chromium.org
authored and
commit-bot@chromium.org
committed
add test that repros issue #47338
This currently fails for the CFE with: static error failures: - Unexpected error at line 137, column 14: A value of type 'int?' can't be assigned to a variable of type 'int' because 'int?' is nullable and 'int' isn't. - Unexpected error at line 137, column 25: Operand of null-aware operation '!' has type 'int' which excludes null. Bug: #47338 Change-Id: Ia55e19a0bf296a8427f6510d6ddda5016acdecea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215101 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Jake Macdonald <jakemac@google.com>
1 parent 46486cf commit ead8b7f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/language/null_aware/access_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,7 @@ main() {
132132
// ^^^^^^^^
133133
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
134134
// [cfe] Member not found: 'hashCode'.
135+
136+
// (C.staticInt?.floor())! can be assigned to int.
137+
int y = (C.staticInt?.floor())!;
135138
}

0 commit comments

Comments
 (0)