Skip to content

Commit 58c70b8

Browse files
scheglovcommit-bot@chromium.org
authored andcommitted
Store the actual static type of IntegerLiteral(s) in summary.
Fixes #35993 Fixes #33441 Change-Id: I369da4e4437db5ae31fb1c4eb7d3ab0657d9ceb5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120520 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Paul Berry <[email protected]>
1 parent a29bc5d commit 58c70b8

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

pkg/analyzer/lib/src/dart/constant/evaluation.dart

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -862,19 +862,6 @@ class ConstantEvaluationEngine {
862862
return true;
863863
}
864864
var objType = obj.type;
865-
if (objType.isDartCoreInt && type.isDartCoreDouble) {
866-
// Work around dartbug.com/35993 by allowing `int` to be used in a place
867-
// where `double` is expected.
868-
//
869-
// Note that this is not technically correct, because it allows code like
870-
// this:
871-
// const Object x = 1;
872-
// const double y = x;
873-
//
874-
// TODO(paulberry): remove this workaround once dartbug.com/33441 is
875-
// fixed.
876-
return true;
877-
}
878865
return typeSystem.isSubtypeOf(objType, type);
879866
}
880867

pkg/analyzer/test/src/diagnostics/variable_type_mismatch_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ main() {
1717
/// to this class.
1818
@reflectiveTest
1919
class VariableTypeMismatchTest extends DriverResolutionTest {
20-
@FailingTest(reason: 'Workaround for #35993 is too broad')
2120
test_int_to_double_variable_reference_is_not_promoted() async {
2221
// Note: in the following code, the declaration of `y` should produce an
2322
// error because we should only promote literal ints to doubles; we

0 commit comments

Comments
 (0)