Fix 16009 - wrong order of static init in recursive module #16054
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue #16009 .
This was happening after introduction of
static let
.However, for incremental classes, the error was always there: https://sharplab.io/#v2:DYLgZgzgNALiCWwA+A7AhgWwKYQA5oGMsACAWQE8AFAJwHsBzazAWACg2NaATAV2BOpYCZbnxIBeYmzbFZxWriwpiAZXIQYWDNNZzi/GMQBG8FF1P1ikgGK1aAdQAW8Ao+tpEEAHQqYaGC6kWkZY1Dp6nLz8xAByOJpcpKLR4jJ6cgbEAEKm5iiWkihYAO7yRgBWABQAlGnpUrpyMOSKxLYOzq72tNQA1hBWdeka/i7E2Bgh1Kp+AQRBk6FWsfFYiclYXjlmFuFNLSTtTi5uHsAQlWgIKDDVg431maYjKEQAgsto6UN6I3PjwSWvlG80B00kcQ0aySUU22zy9B+9QakTExDeBBgPDQwBoDCYGGWQwUShEsOJimUaih2geDT0Jh2+S8ABVaL5qBYasQkAA+YgAYVoKAgtH4XnsnM0ABlTFggA
This minimizes the impact by skipping a fake member generation in case it is not needed for
static let
purposes.The error remains for the (hopefully rare) combination of:
module rec
forward-usage of declared static members
having a static member on a type which needs incremental constructor
Also, the existing failing code does emit the
diagnostics 40
warning about a recursive issue -> but it is not an error.