-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
When using the StringMarshallingCustomType property on a LibraryImport attribute, the generator caches a symbol object, causing the compilation to be kept alive across runs of the generator.
Reproduction Steps
I've included a test case (commented out) in this commit 32f856c (#77130)
Expected behavior
The test should pass.
Actual behavior
The test fails.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
The problem is that the LibraryImportData record type contains a property for the StringMarshallingCustomType property from LibraryImportAttribute and we put that property into our "data model" type IncrementalStubGenerationContext:
Line 30 in 2b1f57e
| LibraryImportData LibraryImportData, |
We need to change how we pass the attribute data between the "compute the model" stage and the "generate code" stage such that the information we need is available, but the symbols are not passed while still having a decently understandable API.