You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
Can you have a variable of type ref ref T or does that always collapse to ref T? What about ref var ref var T?
It seems like ref ref T should collapse/convert to ref T. But the same logic doesn't seem to hold for ref var ref var T.
var x = 5; // x: int
var y = ref var x; // y: ref var int (note ref x would yield the type ref int)
var z = ref var y; // z: ref var ref var int
var zz = ref var z; // zz: ref var ref var ref var int
If ref ref T converts to ref T then ref ref var T should be ref var T. Maybe you simply aren't allowed to take a reference to a variable of type ref (var) T. However, how would that play with generics where you are unsure if the type is a reference or not?
Types like ref var ref T also need to be considered.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Can you have a variable of type
ref ref T
or does that always collapse toref T
? What aboutref var ref var T
?It seems like
ref ref T
should collapse/convert toref T
. But the same logic doesn't seem to hold forref var ref var T
.If
ref ref T
converts toref T
thenref ref var T
should beref var T
. Maybe you simply aren't allowed to take a reference to a variable of typeref (var) T
. However, how would that play with generics where you are unsure if the type is a reference or not?Types like
ref var ref T
also need to be considered.The text was updated successfully, but these errors were encountered: