// (31,24): error CS8521: Cannot use a result of 'Program.Test1(Program.S1)' in this context because it may expose variables referenced by parameter 'arg' outside of their declaration scope
// (31,24): error CS8347: Cannot use a result of 'Program.Test1(Program.S1)' in this context because it may expose variables referenced by parameter 'arg' outside of their declaration scope
// (12,20): error CS8347: Cannot use a result of 'Program.ReturnsRef1(out int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope
// return ref ReturnsRef1(out var _ );
Diagnostic(ErrorCode.ERR_EscapeCall,"ReturnsRef1(out var _ )").WithArguments("Program.ReturnsRef1(out int)","x").WithLocation(12,20)
// return ref ReturnsRef1(out var _);
Diagnostic(ErrorCode.ERR_EscapeCall,"ReturnsRef1(out var _)").WithArguments("Program.ReturnsRef1(out int)","x").WithLocation(12,20)
// (12,20): error CS8347: Cannot use a result of 'Program.ReturnsRef(out int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope
// return ref ReturnsRef(out var z);
Diagnostic(ErrorCode.ERR_EscapeCall,"ReturnsRef(out var z)").WithArguments("Program.ReturnsRef(out int)","x").WithLocation(12,20),
// (17,35): error CS8168: Cannot return local 'z' by reference because it is not a ref local
// (17,20): error CS8347: Cannot use a result of 'Program.ReturnsRef(out int)' in this context because it may expose variables referenced by parameter 'x' outside of their declaration scope
// (23,13): error CS8353: A result of a stackalloc expression of type 'Span<int>' cannot be used in this context because it may be exposed outside of the containing method
// (31,35): error CS8353: A result of a stackalloc expression of type 'Span<int>' cannot be used in this context because it may be exposed outside of the containing method
// (32,35): error CS8353: A result of a stackalloc expression of type 'Span<int>' cannot be used in this context because it may be exposed outside of the containing method
// (23,13): error CS8353: A result of a stackalloc expression of type 'Span<int>' cannot be used in this context because it may be exposed outside of the containing method
// (31,34): error CS8353: A result of a stackalloc expression of type 'Span<int>' cannot be used in this context because it may be exposed outside of the containing method
// (49,13): error CS8353: A result of a stackalloc expression of type 'Span<int>' cannot be used in this context because it may be exposed outside of the containing method
// (60,30): error CS8353: A result of a stackalloc expression of type 'Span<int>' cannot be used in this context because it may be exposed outside of the containing method