exercism / dart

Exercism exercises in Dart.
https://exercism.org/tracks/dart
MIT License
57 stars 94 forks source link

pubspec: Upgrade sdk constraints to Dart 3.2 as minimum #530

Closed Stargator closed 5 months ago

Stargator commented 7 months ago

Upgrade our minimum SDK constraint to 3.2 (the latest version of Dart)

glennj commented 7 months ago

Perhaps this too: https://github.com/exercism/dart/blob/42b0826e8ad2b949cbdd898433795730011522d6/.github/workflows/test.yml#L23

glennj commented 7 months ago

@vaeng, shall we coordinate this PR with a similar upgrade in exercism/dart-test-runner

vaeng commented 7 months ago

I don't know anything about dart compatibility, but I think my changes to the test runner would adapt easily to a new version. I'll do a pr today

vaeng commented 7 months ago

Here is the PR to update the test runner to dart 3.2

glennj commented 7 months ago

@Stargator I see this

warning - bin/create_exercise.dart:295:38 - The operand can't be null, so the condition is always 'true'. Remove the condition. - unnecessary_null_comparison

https://github.com/exercism/dart/blob/42b0826e8ad2b949cbdd898433795730011522d6/bin/create_exercise.dart#L293C3-L295

  final expectedList = retrieveListOfExpected(specCases);

  final dynamic first = expectedList != null && expectedList.isNotEmpty ? expectedList.first : null;

retrieveListOfExpected() returns a Set, so null-safe presumably.

Stargator commented 7 months ago

Yeah, I just made the pubspec changes on Friday and couldn't see the results of the checks until now. All should be resolved there.

Stargator commented 7 months ago

@glennj @vaeng , the checks all pass. Is there anything else or am I good to merge this?

vaeng commented 7 months ago

I did not change anything from the old 2.18 (?) Student files in the test runner, so this subset is still valid. I really never looked at any docs for dart except the test environment (which was not helpful for me). So if anything big has changed between the two versions, I'm the last to notice :D

Stargator commented 7 months ago

@vaeng I think you replying to my question in the dart-test-runner, but the link to the changes is here. As with any major version change, there are breaking changes. But so far, nothing broke in this PR when running the tests for the exercises, but that does not rule out students using other APIs that may have been deprecated or removed.