)]}'
{
  "commit": "172bbe09cdfbe35aa61ea68b4a1fecc7189856f7",
  "tree": "acd37a914d1dfdf92992c81ed76e6a1585dac4e9",
  "parents": [
    "8e219fcd089b6333d196a758f3a7f9b19292ae9a"
  ],
  "author": {
    "name": "Paul Berry",
    "email": "paulberry@google.com",
    "time": "Mon Jun 10 18:07:01 2024 +0000"
  },
  "committer": {
    "name": "Commit Queue",
    "email": "dart-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Mon Jun 10 18:07:01 2024 +0000"
  },
  "message": "Add type tracking to type inference logging.\n\nThis commit updates the type inference logging logic introduced in\nhttps://dart-review.googlesource.com/c/sdk/+/369788 so that it\nadditionally tracks the context and static type for each inferred\nexpression.\n\nTracking the context for each expression is easy, since it is an input\nto the type inference algorithm, passed in to each `visit` method of\n`ResolverVisitor` through the named parameter `contextType`. However,\nthere were a few expression types for which the context type *wasn\u0027t*\npassed in, because it wasn\u0027t used (for example\n`ResolverVisitor.visitBooleanLiteral`, since boolean literals always\nhave the same meaning regardless of their context). `contextType`\nparameters have been added to these `visit` methods for consistency\nwith the other expression visit methods, so that the type inference\nlog shows the context for all expressions, whether it makes a\ndifference to inference or not.\n\nTracking the static type for each expression is a little trickier,\nsince it\u0027s not an explicit output of the type inference algorithm, but\nrather the static type of each expression is set as a side effect of\nthe type inference mechanism. To make things more tractable, the\n`ExpressionImpl.staticType` field is made private, and instead of\nsetting it directly, the resolver must set it by either calling\n`recordStaticType` or `setPseudoExpressionStaticType`. The former is\nused when resolving a real expression; the latter is used for\nsituations where the analyzer assigns a static type to an AST node\neven though that AST node isn\u0027t really serving as an expression\naccording to the official language specification. (For example, when\nanalyzing the method invocation `x.foo()`, the analyzer stores a\nstatic type on the SimpleIdentifier `foo`, even though according to\nthe language spec, `foo` in this context actually isn\u0027t an expression\nin its own right).\n\nSplitting the code paths that set static types into `recordStaticType`\nand `setPseudoExpressionStaticType` allows for the type inference\nlogging mechanism to check some useful invariants: it verifies that\nevery expression that the resolver visits is either assigned a static\ntype exactly once through a call to `recordStaticType`, or it\u0027s\ndetermined to not be a true expression (and hence not assigned a\nstatic type at all); I believe the latter happens mostly when\nanalyzing erroneous code, or when the resolver visitor is called upon\nto assign a type to an identifier that\u0027s in a declaration context.\n\nChange-Id: Icdf023d03fba3c87dbec3a72d00d0e9c7d1da5fa\nReviewed-on: https://dart-review.googlesource.com/c/sdk/+/370322\nReviewed-by: Chloe Stefantsova \u003ccstefantsova@google.com\u003e\nCommit-Queue: Paul Berry \u003cpaulberry@google.com\u003e\nReviewed-by: Konstantin Shcheglov \u003cscheglov@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9093292e550279efd4bcccf46c4a951354b977bb",
      "old_mode": 33188,
      "old_path": "pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart",
      "new_id": "b2806161dcc641db37b84f670bc53598e12ee7cc",
      "new_mode": 33188,
      "new_path": "pkg/_fe_analyzer_shared/lib/src/type_inference/shared_inference_log.dart"
    },
    {
      "type": "modify",
      "old_id": "52b3e1553066c6c620be0e510cf2bb21b2876b8a",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/ast/ast.dart",
      "new_id": "7e091a23edfd9c7251cbd0418e1a790cc6674227",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/ast/ast.dart"
    },
    {
      "type": "modify",
      "old_id": "614de3e351153cc4c850d0d39830bc014a2583df",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/constant/evaluation.dart",
      "new_id": "c52e307bcca349ae16b73529e7976e257bc0d2f3",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/constant/evaluation.dart"
    },
    {
      "type": "modify",
      "old_id": "9d5c456a97e2ea4ef271b8355f5778515828b871",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/element/element.dart",
      "new_id": "5dde963bfab9ee580932b00fec8e455d745a1635",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/element/element.dart"
    },
    {
      "type": "modify",
      "old_id": "db7937e800535af42d0ca6f56088abe7d9529062",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart",
      "new_id": "64a30e5089985b00f05209090d169a50a1a8881c",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "6626cee733c5c3a88ef307b091c063e46f54b55c",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart",
      "new_id": "f3ddc80bd71b759225791f35f7a724816c9a6b16",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "13d9a16409f71c2b93e5066490d3d0f7ba20b2c9",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/constructor_reference_resolver.dart",
      "new_id": "1d125999c79d5e85d15a302a9cf20aef19f9f063",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/constructor_reference_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "33fa26bb9f6ced23e5004d8bf529c1b1ebe28b8a",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart",
      "new_id": "77611bce7f7a30963e2ad7b202fb7e565b411467",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "25edc9f8f225b86353461f4f524f6b4971111f45",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart",
      "new_id": "128bb28cbe4b89d0365317255d523486e0fb548c",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "fb37c62703cf45750b57a7956e84132c712d65eb",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/function_expression_resolver.dart",
      "new_id": "2379ee83a23fed0fff28443792d81a8e89223282",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/function_expression_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "4bbf9879156219e67b74f45a57ac60b1ee87dcd6",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart",
      "new_id": "4aa9699f954e11393331470b34f494fce9426931",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "1ea9f19263754e67037f979d5fd153c948ef88d7",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart",
      "new_id": "1d7c5a9bd24a9d14960fe0a04c911bd3a533abd9",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "18b1dfad1683c58fd35cff802b6894d8a3b26160",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart",
      "new_id": "9fb75a8138e2cb5626a977a02a5d901acfba3702",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart"
    },
    {
      "type": "modify",
      "old_id": "addab92b240a2eb194a9967613e5a12dd9d1dfb9",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart",
      "new_id": "4d94013aba85834f964275d572efc4058e46115e",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "477b67687c342ebe341d04448d5ab55ba277d229",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart",
      "new_id": "65de7406784ab0438a540eed95e0d837ba6ec3e9",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "ca937938cfbc61fa275aac68be89f26161d48c54",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart",
      "new_id": "7e9b0e7966376436889481e761ac2fd93e27838d",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "875ad9a82503e5fd9ab41bdcb5bf236a6187ede3",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart",
      "new_id": "1176e7cc2d6604f24e0acf189481e3497a24daf5",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "0a6d0e7e45b38594a3e0a937ed10b798d604ab45",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/record_literal_resolver.dart",
      "new_id": "d683bb1a71c7f0d96097de7e71e5b246b06b6b36",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/record_literal_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "d8c9e2fe554006a9df49e5a50f8cef7fe8366875",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart",
      "new_id": "5a8a6fdf61640d926cc37ca4723d86e0c7b22069",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "9d129bc4437fa7eaca450025f504feaf09dc7ae6",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart",
      "new_id": "bd8f77062f0a5f317de48d4ade773f659c2e9c24",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "8f1bfe493ee9b130ba75948bdbcb49aa4f5f789b",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/generated/inference_log.dart",
      "new_id": "7c6aeb1b555058ce8494470677fd8ef11d024278",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/generated/inference_log.dart"
    },
    {
      "type": "modify",
      "old_id": "6a1a03f23f1b3f5eaaae35625413df6302bc307f",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/generated/resolver.dart",
      "new_id": "aa12914666c7a6160178604a31141449b381cd64",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/generated/resolver.dart"
    },
    {
      "type": "modify",
      "old_id": "41c780e66a4794128d619b9f87ec6e0346192606",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/generated/static_type_analyzer.dart",
      "new_id": "376a9486c5c7f61eeb3e467c21e04d447175ac0a",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/generated/static_type_analyzer.dart"
    },
    {
      "type": "modify",
      "old_id": "fe50d77a622b9d9c32fd85569956250fb8c6070f",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/summary2/ast_binary_reader.dart",
      "new_id": "c00946076a9b36bd1d2ae2151371dbaa47fac20f",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/summary2/ast_binary_reader.dart"
    },
    {
      "type": "modify",
      "old_id": "1b5ce92af0586324f8307dce4672b8d901cf9e5e",
      "old_mode": 33188,
      "old_path": "pkg/analyzer/lib/src/task/strong_mode.dart",
      "new_id": "7d1e2216fdba786f320b2cfe78cf4569948ed23c",
      "new_mode": 33188,
      "new_path": "pkg/analyzer/lib/src/task/strong_mode.dart"
    },
    {
      "type": "modify",
      "old_id": "63ee6ea6b63e5ef56c10a65d85054f2f498e12c5",
      "old_mode": 33188,
      "old_path": "pkg/front_end/test/spell_checking_list_code.txt",
      "new_id": "11ca3c687daf8674d83f42bfe3866c013ab84ce5",
      "new_mode": 33188,
      "new_path": "pkg/front_end/test/spell_checking_list_code.txt"
    }
  ]
}
