I'm working on implementation for isolated synchronous deinit and as I started to write more unit tests, I realised that I don't properly understand the logic for adding attributes encoding inferred actor-isolation.
Logic seems to originate from this commit by @Douglas_Gregor. And in the original version when isolation was inferred from the overridden declaration, attributes were recorded. But in the current implementation in this case execution falls through to the final return which does not record inferred isolation.
Should isolation be recorded in this case as well? If not, why?
We synthesize attributes (or modifiers) for nonisolated or global actor isolation, because those can be represented in the source code and it saves other clients (e.g., those parsing Swift interface files) from redoing that work. We don't synthesize any attributes for actor instance isolation, because they are not expressible in the source language and are generally cheap to recompute.
To check my understanding - if attributes were not added, then files importing modules would take more time to compile, but result still would be correct, right?
My main question is why attributes are not synthesised when they are inferred from overriden declarations? In the original implementation it was working, but in the current implementation, it doesn't anymore. Is this an intentional change, or a bug?
I was able to test on Linux, but had two failures which were not present on CI, in seemingly unrelated tests, might be something off with my setup. No luck in testing on Windows, but Windows failures seem to be a subset of Linux failures, so I guess it also should be fine now.