Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust the implements clause of IntX #866

Merged
merged 3 commits into from
Feb 28, 2025
Merged

Conversation

eernstg
Copy link
Member

@eernstg eernstg commented Feb 27, 2025

Adjust the implements clause of IntX.

See dart-lang/sdk#59776 for breaking change processing.

Currently, IntX implements Comparable<Object>. This causes the equation X extends Comparable<X> to have no solution which is a supertype of IntX (and, hence, Int64 and Int32). This is inconvenient because it causes invocations of methods like the extension method sortedBy to fail: There is no actual type argument that satisfies the constraints.

With this PR, IntX is a subtype of Comparable<IntX>, which means that said methods can now be invoked. Type inference fails when the language version is below 3.7.0 (so the type argument IntX must be provided explicitly), but from 3.7.0 and up the feature 'inference-using-bounds' is enabled by default, and type inference will then succeed.

Copy link

Package publishing

Package Version Status Publish tag (post-merge)
package:args 2.6.1-wip WIP (no publish necessary)
package:async 2.13.0 already published at pub.dev
package:characters 1.4.0 already published at pub.dev
package:collection 1.20.0-wip WIP (no publish necessary)
package:convert 3.1.2 already published at pub.dev
package:crypto 3.0.6 already published at pub.dev
package:fixnum 1.2.0 ready to publish fixnum-v1.2.0
package:lints 6.0.0-wip WIP (no publish necessary)
package:logging 1.3.0 already published at pub.dev
package:os_detect 2.0.3 already published at pub.dev
package:path 1.9.2-wip WIP (no publish necessary)
package:platform 3.1.6 already published at pub.dev
package:typed_data 1.4.0 already published at pub.dev

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

Copy link

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ⚠️
File Coverage
pkgs/fixnum/lib/src/intx.dart 💔 Not covered

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, 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.
Files
no missing headers

All source files should start with a license header.

1 similar comment
Copy link

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ⚠️
File Coverage
pkgs/fixnum/lib/src/intx.dart 💔 Not covered

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, 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.
Files
no missing headers

All source files should start with a license header.

@eernstg eernstg requested review from devoncarew and lrhn February 27, 2025 13:09
@eernstg
Copy link
Member Author

eernstg commented Feb 27, 2025

The test coverage check fails. The page about test coverage states that "Test coverage should not decrease by introducing a PR", but I can't see how this PR would have that effect. @devoncarew, can you say something about how is this usually handled?

@devoncarew
Copy link
Member

The test coverage check fails. The page about test coverage states that "Test coverage should not decrease by introducing a PR", but I can't see how this PR would have that effect. @devoncarew, can you say something about how is this usually handled?

The coverage check is informational. It looks like the health check is failing, and likely due to a bug in the api check tool: https://github.com/dart-lang/core/actions/runs/13566672156/job/37921655020?pr=866#step:12:159.

That check is trying to diff this current change vs. the last published one, and determine what type of semver bump should be done (major? minor? service?). I'll add a label to skip the health check for this PR.

Copy link
Member

@devoncarew devoncarew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will leave the approve to @lrhn -

eernstg and others added 2 commits February 28, 2025 14:37
Change the new version to -wip.

Co-authored-by: Devon Carew <devoncarew@google.com>
Change the new version to -wip

Co-authored-by: Devon Carew <devoncarew@google.com>
@eernstg
Copy link
Member Author

eernstg commented Feb 28, 2025

Thanks!

@lrhn, do you have further comments?

Copy link

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

Coverage ⚠️
File Coverage
pkgs/fixnum/lib/src/intx.dart 💔 Not covered

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, 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.
Files
no missing headers

All source files should start with a license header.

@eernstg eernstg merged commit db610bb into main Feb 28, 2025
13 checks passed
@eernstg eernstg deleted the adjust_IntX_implements_feb25 branch February 28, 2025 16:59
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Mar 18, 2025
Revisions updated by `dart tools/rev_sdk_deps.dart`.

core (https://github.com/dart-lang/core/compare/9f43210..61e6771):
  61e67710  2025-03-12  Moritz  Check for mandatory when using option (dart-lang/core#871)
  77d33c83  2025-03-04  Devon Carew  Update publish.yaml (dart-lang/core#870)
  db610bb5  2025-02-28  Erik Ernst  Adjust the implements clause of IntX (dart-lang/core#866)
  22d8879f  2025-02-27  Devon Carew  [package:lints] fix the changelog (dart-lang/core#867)
  2f0325e9  2025-02-26  Devon Carew  Contribute a Gemini Code Assist config (dart-lang/core#865)

ecosystem (https://github.com/dart-lang/ecosystem/compare/a3cc42d..5b8e6b8):
  5b8e6b8  2025-03-17  Devon Carew  [dart_flutter_team_lints] remove 'discarded_futures'; prep for publishing (dart-lang/ecosystem#347)
  b96e5d2  2025-03-14  Devon Carew  Add the discarded_futures lint; rev for publishing (dart-lang/ecosystem#346)

http (https://github.com/dart-lang/http/compare/001665e..9129a96):
  9129a96  2025-03-13  Brian Quinlan  Prepare to release cupertino_http 2.1.0 (dart-lang/http#1727)
  91d8719  2025-03-13  Brian Quinlan  Upgrade to `package:objective_c` 7.0.0 (dart-lang/http#1726)

i18n (https://github.com/dart-lang/i18n/compare/b09c822..d9cce0b):
  d9cce0b  2025-03-13  Moritz  Grab new artifacts from version `intl4x-icu-v.0.11.2-artifacts` (dart-lang/i18n#957)

protobuf (https://github.com/dart-lang/protobuf/compare/7838e44..0bab78d):
  0bab78d  2025-03-14  Devon Carew  rename -dev pubspec versions to -wip (google/protobuf.dart#968)

tools (https://github.com/dart-lang/tools/compare/9c53358..62bc13b):
  62bc13bc  2025-03-17  Kevin Moore  [markdown, stream_transform] Fix deprecated usage of pkg:web (dart-lang/tools#2046)
  f1a5e7a2  2025-03-17  Devon Carew  [package:markdown] update package:web references in the example (dart-lang/tools#2039)
  a4ae1759  2025-03-17  Nate Bosch  [package_config] Update language version and reformat (dart-lang/tools#2040)
  a2af1447  2025-03-17  Nate Bosch  [package_config] Remove unnecessary casts to Uint8List (dart-lang/tools#2041)
  07ebd15d  2025-03-14  Devon Carew  [package:mime] generate a markdown table of the current mime mappings (dart-lang/tools#2038)
  920fdb64  2025-03-13  dependabot[bot]  Bump dart-lang/setup-dart from 1.7.0 to 1.7.1 in the github-actions group (dart-lang/tools#2022)
  b55643da  2025-03-13  David Iglesias  [html] Allow ampersands in attribute values. (dart-lang/tools#2036)

Change-Id: I2998ebecfdc7b1790a74a8ab2128895694658a5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416023
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants