)]}'
{
  "commit": "fc387f0f7be6d83ba2349b9986c553ef63f9cffb",
  "tree": "0435bb86b73e6f87dbaf3a2cfb4de1a84ba1e2d6",
  "parents": [
    "6fd249d3793b71dff435803ead85bbafe781dd46"
  ],
  "author": {
    "name": "Paul Berry",
    "email": "paulberry@google.com",
    "time": "Thu Jul 20 20:14:39 2023 +0000"
  },
  "committer": {
    "name": "Commit Queue",
    "email": "dart-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Thu Jul 20 20:14:39 2023 +0000"
  },
  "message": "Update SDK to prepare for enabling `interface-update-2`.\n\nSeveral locations in the core SDK contain `!` or `?.` operations that\nwill become unnecessary once the language feature `inference-update-2`\n(which provides field promotion) is enabled.  For example, in this\nmethod from the class `_IOOverridesScope`, `_previous` refers to a\nprivate final field, so after field promotion is enabled, the test `if\n(_previous !\u003d null)` will promote it, and the `!` in\n`_previous!.createDirectory` will become unnecessary:\n\n    Directory createDirectory(String path) {\n      if (_createDirectory !\u003d null) return _createDirectory!(path);\n      if (_previous !\u003d null) return _previous!.createDirectory(path);\n      return super.createDirectory(path);\n    }\n\nSince the SDK is built in a mode where warnings like this result in\nbuild failures, we need to temporarily change the logic into a form\nwhere the same promotion effect is achieved through local variable\ntype promotion:\n\n    Directory createDirectory(String path) {\n      if (_createDirectory !\u003d null) return _createDirectory!(path);\n      var previous \u003d _previous;\n      if (previous !\u003d null) return previous.createDirectory(path);\n      return super.createDirectory(path);\n    }\n\n(Note that `_createDirectory` doesn\u0027t need to change, because it is a\nnon-final field, so it won\u0027t undergo promotion).\n\nAfter `interface-update-2` has been enabled, I will make a follow-up\nCL that removes the local variables and simply takes advantage of\nfield promotion, e.g.:\n\n    Directory createDirectory(String path) {\n      if (_createDirectory !\u003d null) return _createDirectory!(path);\n      if (_previous !\u003d null) return _previous.createDirectory(path);\n      return super.createDirectory(path);\n    }\n\nNote: in theory it would be possible to do all this in a single step,\nby atomically enabling field promotion and changing the SDK in the\nsame CL. However, I prefer breaking it up into stages like this,\nbecause the act of flipping a langauge flag on tends to have\nwide-ranging consequences, so I want the CL that does the flip to be\nas small as possible.\n\nChange-Id: I421c7661348bf407093ee64ef7f9dbfc0c04a353\nBug: https://github.com/dart-lang/language/issues/2020\nReviewed-on: https://dart-review.googlesource.com/c/sdk/+/314500\nReviewed-by: Siva Annamalai \u003casiva@google.com\u003e\nReviewed-by: Sigmund Cherem \u003csigmund@google.com\u003e\nReviewed-by: Bob Nystrom \u003crnystrom@google.com\u003e\nCommit-Queue: Paul Berry \u003cpaulberry@google.com\u003e\nReviewed-by: Lasse Nielsen \u003clrn@google.com\u003e\nReviewed-by: Joshua Litt \u003cjoshualitt@google.com\u003e\nReviewed-by: Stephen Adams \u003csra@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "679c0083ba781cdebba66496679bdb3867455f5c",
      "old_mode": 33188,
      "old_path": "sdk/lib/_http/http_impl.dart",
      "new_id": "137e1063021bf448a49898fe2a9cd720656d9f85",
      "new_mode": 33188,
      "new_path": "sdk/lib/_http/http_impl.dart"
    },
    {
      "type": "modify",
      "old_id": "428a1ec798852facb14b23c81e043e32a5d7ac1b",
      "old_mode": 33188,
      "old_path": "sdk/lib/developer/timeline.dart",
      "new_id": "c88ef0889cc138bcfdf5e3ba367998cd6c3014dd",
      "new_mode": 33188,
      "new_path": "sdk/lib/developer/timeline.dart"
    }
  ]
}
