Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(followup to 941974e) I'm not sure why I was reflexively resistant to this. Probably I was just in a hurry to submit? :) It's not as if the logic in `enclosingClass` is arcane. While I still don't think we need to worry that any of our calls to `enclClass` are happening on a module or a class itself—and if we do, we'll likely have bigger problems with the other nearby operations on `sym.owner`—I think it's probably better to "default" to using `enclosingClass`, which at least squirrels away this one particular use of internal APIs in a single location. That's especially true when it would not _quite_ be safe for us to mechanically replace every `enclClass` call with an `enclosingClass` call, thanks to the slightly differences in behavior. But here, not only do I claim that there should be no difference in behavior, but I actually tested. PiperOrigin-RevId: 500171678
- Loading branch information