Skip to content

Commit 3c7027a

Browse files
Remove incorrect flag setting (#88878)
This was added in #85743 (comment). Setting this flag is not the right thing to do. It sweeps issues under the carpet. Also, we're only doing it for signature type variables, not method variable. And since no tests seem to be failing, it might not even be necessary.
1 parent 08a6e06 commit 3c7027a

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/coreclr/tools/Common/TypeSystem/Common/SignatureVariable.cs

+21-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,16 @@ protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
6666
flags |= TypeFlags.SignatureTypeVariable;
6767
}
6868

69-
flags |= TypeFlags.AttributeCacheComputed;
69+
// ******************************************************
70+
// Do not add other flags here. If you're hitting asserts
71+
// because a flag wasn't set, this is a bug in the
72+
// calling code. The fix is not here.
73+
//
74+
// The calling code is asking questions that are not
75+
// possible to answer for signature variables
76+
// (like: is this ByRef-like? We won't know until
77+
// a substitution happens. Any answer would be wrong.)
78+
// ******************************************************
7079

7180
return flags;
7281
}
@@ -105,6 +114,17 @@ protected override TypeFlags ComputeTypeFlags(TypeFlags mask)
105114
flags |= TypeFlags.SignatureMethodVariable;
106115
}
107116

117+
// ******************************************************
118+
// Do not add other flags here. If you're hitting asserts
119+
// because a flag wasn't set, this is a bug in the
120+
// calling code. The fix is not here.
121+
//
122+
// The calling code is asking questions that are not
123+
// possible to answer for signature variables
124+
// (like: is this ByRef-like? We won't know until
125+
// a substitution happens. Any answer would be wrong.)
126+
// ******************************************************
127+
108128
return flags;
109129
}
110130

0 commit comments

Comments
 (0)