Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@bergkampben
Copy link
Contributor

@bergkampben bergkampben commented Sep 14, 2022

Enables null safety in compiler.dart and dart_profiler_symbols.dart
Contributes to flutter/flutter#110016, flutter/flutter#110020

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

await run(buildIdDir, buildIdScript, nm, binary, output);
}

class Symbol {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we have all the info we need to set all these fields at construction-time, so should we add a constructor that takes offset, size and name and remove the lates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed. fixed.

@akbiggs akbiggs changed the title Enable dart null-safety [fuchsia] Enable dart null-safety for Fuchsia .dart files Sep 14, 2022
int size;
String name;

Symbol(this.offset, this.size, this.name);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: for readability at the call site, maybe do

Symbol({required this.offset, required this.size, required this.name});

and then call it as:

final symbol = Symbol(offset: int.parse(match[1]!, radix: 16),
                      size: int.parse(match[2]!, radix: 16),
                      name: match[4]!.split("(")[0]);

so that the reader can tell what each value represents at the call site.

(the new keyword is unnecessary, it does the same thing without it in Dart 2).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I'm not experienced with dart so any tips like this are vey helpful!

@Hixie
Copy link
Contributor

Hixie commented Sep 15, 2022

test-exempt: code refactor with no semantic change

@bergkampben bergkampben merged commit 5e6b0d8 into flutter:main Sep 15, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 15, 2022
zanderso pushed a commit to flutter/flutter that referenced this pull request Sep 15, 2022
…111696)

* 06fe761f6 [Impeller] Make gradients work as expected (flutter/engine#36140)

* f18d17ba8 Roll Skia from 962fd1f9abfc to 6e0e0a9f6cbf (3 revisions) (flutter/engine#36174)

* 5e6b0d813 Enable dart null-safety (flutter/engine#36154)

* ccba311e2 Fix typo (flutter/engine#36167)

* b828d3079 [lint] Enforce kCamelCase for global constants (flutter/engine#36175)

* 9a6caba29 Roll Skia from 6e0e0a9f6cbf to 7c2dc625d01e (2 revisions) (flutter/engine#36178)
Oleh-Sv pushed a commit to Oleh-Sv/engine that referenced this pull request Sep 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants