Skip to content

Commit e9daa98

Browse files
sjindel-googlecommit-bot@chromium.org
authored andcommitted
[fasta] Remove unnecessary unary negation for the minimum 64-bit integer.
Change-Id: I5ebf49427ac4ddd005c490d1f04880f005211d26 Reviewed-on: https://dart-review.googlesource.com/33943 Commit-Queue: Samir Jindel <[email protected]> Reviewed-by: Peter von der Ahé <[email protected]>
1 parent 813be08 commit e9daa98

File tree

7 files changed

+25
-7
lines changed

7 files changed

+25
-7
lines changed

pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2222,16 +2222,15 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
22222222
if (optional("-", token)) {
22232223
operator = "unary-";
22242224

2225-
var new_receiver = null;
22262225
if (receiver is LargeIntAccessor) {
22272226
int value =
22282227
int.parse("-" + receiver.token.lexeme, onError: (_) => null);
22292228
if (value != null) {
2230-
new_receiver = new ShadowIntLiteral(value)
2231-
..fileOffset = offsetForToken(token);
2229+
push(new ShadowIntLiteral(value)
2230+
..fileOffset = offsetForToken(token));
2231+
return;
22322232
}
22332233
}
2234-
if (new_receiver != null) receiver = new_receiver;
22352234
}
22362235
bool isSuper = false;
22372236
Expression receiverValue;

pkg/front_end/testcases/ast_builder.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,4 @@ super_call: Crash
145145
type_variable_as_super: Crash
146146
uninitialized_fields: Crash
147147
warn_unresolved_sends: Fail
148+
minimum_int: Crash
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
main() => print(-9223372036854775808);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
library;
2+
import self as self;
3+
import "dart:core" as core;
4+
5+
static method main() → dynamic
6+
return core::print(-9223372036854775808);
7+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
library;
2+
import self as self;
3+
4+
static method main() → dynamic
5+
;
6+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
library;
2+
import self as self;
3+
import "dart:core" as core;
4+
5+
static method main() → dynamic
6+
return core::print(-9223372036854775808);
7+

tests/language_2/language_2_dartdevc.status

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ abstract_syntax_test/00: MissingCompileTimeError
124124
additional_interface_adds_optional_args_concrete_subclass_test: MissingCompileTimeError
125125
additional_interface_adds_optional_args_concrete_test: MissingCompileTimeError
126126
additional_interface_adds_optional_args_supercall_test: MissingCompileTimeError
127-
arithmetic_test: RuntimeError # Issue 31763
128127
assertion_initializer_const_error2_test/cc01: MissingCompileTimeError
129128
assertion_initializer_const_error2_test/cc02: MissingCompileTimeError
130129
assertion_initializer_const_error2_test/cc03: MissingCompileTimeError
@@ -418,7 +417,6 @@ method_override8_test/00: MissingCompileTimeError
418417
method_override8_test/01: MissingCompileTimeError
419418
method_override8_test/03: MissingCompileTimeError
420419
method_override_test: CompileTimeError # Issue 31616
421-
mint_compares_test: RuntimeError # Issue 31763
422420
mixin_black_listed_test/02: MissingCompileTimeError
423421
mixin_forwarding_constructor4_test/01: MissingCompileTimeError
424422
mixin_forwarding_constructor4_test/02: MissingCompileTimeError
@@ -996,4 +994,3 @@ void_type_usage_test/setter_assign: CompileTimeError # Issue 30514
996994
[ $compiler == dartdevk || $compiler == dartdevc && $runtime == none ]
997995
instantiate_type_variable_test/01: CompileTimeError
998996
setter_no_getter_call_test/01: CompileTimeError
999-

0 commit comments

Comments
 (0)