)]}'
{
  "commit": "2175e2f57331cbcd32bccc47fa7fe7a6874a69a3",
  "tree": "d16af47d239c050c58628a3f485622400ba2fb8d",
  "parents": [
    "4d2b528795fe2534398d1b1a978e1037d4a9d2f0"
  ],
  "author": {
    "name": "Matthew Dempsky",
    "email": "mdempsky@google.com",
    "time": "Sat May 29 15:35:18 2021 -0700"
  },
  "committer": {
    "name": "Matthew Dempsky",
    "email": "mdempsky@google.com",
    "time": "Fri Jun 04 04:28:10 2021 +0000"
  },
  "message": "[dev.typeparams] cmd/compile: lazy import resolution for types2\n\nThis CL adds three new functions to the types2 API to support lazy\nimport resolution:\n\n1. A new Scope.InsertLazy method to allow recording that Objects exist\nin a particular Scope (in particular, package scopes) without having\nto yet fully construct those objects. Instead, types2 will call the\nprovided `resolve` function if/when the object is actually needed.\n\n2. Similarly, a new NewTypeNameLazy function to create TypeName\nobjects without yet instantiating their underlying Named\ninstance.\n\n3. Finally, an InstantiateLazy method, that allows creating type\ninstances without requiring any of the types to be expanded right\naway. Importantly, this requires providing a types2.Checker argument\nto handle recursive types correctly.\n\nThe APIs as-is are a bit clumsy (esp. NewTypeNameLazy), but seem to\nwork well for cmd/compile\u0027s needs. In particular, they simplify some\nof the complexities of handling recursive type definitions within the\nimporter.\n\nAlso, the current prototype is a bit fragile. It uses sync.Once to\nmanage concurrent lazy resolution, which is frustrating to debug in\nthe presence of reentrancy issues. It also means the importer needs to\ndeal with concurrency as well. These aren\u0027t issues for types2 though\nas cmd/compile only walks the type-checked AST sequentially.\n\nFinally, it looks like some of the details of lazy type names are\nsimilar to the lazy \"instance\" stuff used for generics, so maybe\nthere\u0027s opportunity for unifying them under a more general (but still\ninternal) lazy type mechanism.\n\nI had originally intended for this CL to also update the types2\nimporter, but (1) it doesn\u0027t have access to the types2.Checker\ninstance needed to call InstantiateLazy, and (2) it creates a new\nTypeName/TypeParam at each use rather than reusing them, which\nevidently works with types2.Instantiate but not\ntypes2.(*Checker).instantiate (i.e., InstantiateLazy). I spent a while\ntrying to fix these issues, but kept running into more subtle\nissues. Instead, I\u0027ve included my WIP \"unified IR\" CL as a followup CL\nthat demonstrates these Lazy methods (see noder/reader2.go).\n\nUpdates #46449.\n\nChange-Id: I4d1e8e649f6325a11790d25fd90c39fa07c8d41d\nReviewed-on: https://go-review.googlesource.com/c/go/+/323569\nRun-TryBot: Matthew Dempsky \u003cmdempsky@google.com\u003e\nTrust: Matthew Dempsky \u003cmdempsky@google.com\u003e\nTrust: Robert Griesemer \u003cgri@golang.org\u003e\nTryBot-Result: Go Bot \u003cgobot@golang.org\u003e\nReviewed-by: Robert Griesemer \u003cgri@golang.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f80a918467e6cf81c8312c07f841e8346053b081",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/check.go",
      "new_id": "5d3c2c8ad253855ce74f644aa8a009b67ef487b9",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/check.go"
    },
    {
      "type": "modify",
      "old_id": "aa70f3880b8d3ad37c4329f91e0f781460e388f4",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/decl.go",
      "new_id": "00b4ef70107063205f9d4d188f13a52b4f2d5108",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/decl.go"
    },
    {
      "type": "modify",
      "old_id": "0df52e851c9de4b6f02726325ad1698fb73c060e",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/instantiate.go",
      "new_id": "85c897a9097e3db9f081a11741effa6c4a33ce98",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/instantiate.go"
    },
    {
      "type": "modify",
      "old_id": "d3206988b54b69d41fd525e6ba9beec487b3e8ba",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/labels.go",
      "new_id": "6f02e2fc969b084f4c86496ff8e9cc0999be2f6c",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/labels.go"
    },
    {
      "type": "modify",
      "old_id": "eb2b17dd4debd1f7043cf385a1044f131e88691a",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/lookup.go",
      "new_id": "93ed620449e187c388d88928cccd698be11a9795",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/lookup.go"
    },
    {
      "type": "modify",
      "old_id": "8ed55f1dbf9c28d12ecfa3bfea2534e8cbafa61d",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/object.go",
      "new_id": "82297ff17f11ea035da3b572cade6c44a79c4081",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/object.go"
    },
    {
      "type": "modify",
      "old_id": "74436836cd86c2823207b48b26d47bb4f84d2234",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/predicates.go",
      "new_id": "66de249044067e9bad5c28170a6c384380da7486",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/predicates.go"
    },
    {
      "type": "modify",
      "old_id": "9b1482b14e1b075471e65765f943093e4af8bfd4",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/resolver.go",
      "new_id": "018a20cfb2dc69722ce32b9e15aa3985d6538205",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/resolver.go"
    },
    {
      "type": "modify",
      "old_id": "03aef90fe132358cb7cd6b5d5c7a42d7f839e31e",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/sanitize.go",
      "new_id": "4e654e074fcceb6aa0caaed7159f3299b37d90ef",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/sanitize.go"
    },
    {
      "type": "modify",
      "old_id": "ade0a79b31d11daf4fab28c7094d15b8175f22b7",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/scope.go",
      "new_id": "2f1814a6319773d9dc345fa1f365c3e62106c784",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/scope.go"
    },
    {
      "type": "modify",
      "old_id": "c8c4cca0a781536697229bde023735098ae0b0d0",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/signature.go",
      "new_id": "a7edc5ac03d78aff4a7f2211df7685948e842788",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/signature.go"
    },
    {
      "type": "modify",
      "old_id": "daa039bf92a0b2cbe37d3f36c4a0c7d76785d1b3",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/sizeof_test.go",
      "new_id": "3cb162764c815e6610bbfab6b7d7ecea67955ff2",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/sizeof_test.go"
    },
    {
      "type": "modify",
      "old_id": "e9ffd4f5ca9c681691883d21b2ed9ff56fcaf46a",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/stmt.go",
      "new_id": "ab6643212641ef7fbe0fa686e446a43cacda8990",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/stmt.go"
    },
    {
      "type": "modify",
      "old_id": "35ca197d64cdbdcf5e54c8a68656a3abc5a0c928",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/subst.go",
      "new_id": "dd8dd74161e43e715a34943ed56378d8bb30f1e5",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/subst.go"
    },
    {
      "type": "modify",
      "old_id": "92f35f1279c7f164c707bad8bfbf65a6cea77714",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/type.go",
      "new_id": "604520d27f80253eaf93e107d56e07984fc6df2b",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/type.go"
    },
    {
      "type": "modify",
      "old_id": "28583b62d9a8cb479caf32f18abf390fd765fa1b",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/typestring.go",
      "new_id": "07ed510d1188ad09f1d83a9b57d9e06882d5ecd3",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/typestring.go"
    },
    {
      "type": "modify",
      "old_id": "b27b2a00df024c3636e7e8fb6c98bbf8e4bfacd4",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/types2/typexpr.go",
      "new_id": "583bb464b2036d443aa9e0676065fdb13a390a85",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/types2/typexpr.go"
    }
  ]
}
