Description
Possibly related to #69490
Reproduction Steps
- Try compiling this code
[LoggerMessage(Level = LogLevel.Information, Message = "No recipients. DiscussionId={DiscussionId} AlertType={AlertType}")]
public static partial void LogNoDicusionRecipients(this ILogger logger, string alertType, int discusionId);
- See that generator haven't generated
var DiscussionId = this._discusionId; line:

Expected behavior
Generator generates valid code
Actual behavior
Generator generates code that doesn't compile
Regression?
No response
Known Workarounds
No response
Configuration
- .NET 6.0.300
- Windows 11
- VS 17.2.2
- Microsoft.Extensions.Logging.Generators 6.0.6.21309
Other information
No response