16 overrides of IsRefLikeType
Microsoft.CodeAnalysis.CSharp (14)
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (1)
103
public sealed override bool
IsRefLikeType
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (1)
153
public sealed override bool
IsRefLikeType
Symbols\ArrayTypeSymbol.cs (1)
239
public sealed override bool
IsRefLikeType
Symbols\DynamicTypeSymbol.cs (1)
111
public sealed override bool
IsRefLikeType
Symbols\ErrorTypeSymbol.cs (1)
106
public sealed override bool
IsRefLikeType
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
76
public override bool
IsRefLikeType
=> false;
Symbols\FunctionTypeSymbol.cs (1)
104
public override bool
IsRefLikeType
=> false;
Symbols\Metadata\PE\PENamedTypeSymbol.cs (1)
2236
public override bool
IsRefLikeType
Symbols\PointerTypeSymbol.cs (1)
111
public sealed override bool
IsRefLikeType
Symbols\Source\SourceMemberContainerSymbol.cs (1)
822
public sealed override bool
IsRefLikeType
=> HasFlag(DeclarationModifiers.Ref);
Symbols\Synthesized\SynthesizedContainer.cs (1)
148
public sealed override bool
IsRefLikeType
=> false;
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
90
public override bool
IsRefLikeType
=> false;
Symbols\TypeParameterSymbol.cs (1)
594
public sealed override bool
IsRefLikeType
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
227
public override bool
IsRefLikeType
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (1)
Symbols\EENamedTypeSymbol.cs (1)
324
public sealed override bool
IsRefLikeType
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\MockNamedTypeSymbol.cs (1)
195
public sealed override bool
IsRefLikeType
65 references to IsRefLikeType
Microsoft.CodeAnalysis.CSharp (49)
Binder\Binder.ValueChecks.cs (18)
53
Debug.Assert(parameter.RefKind.IsWritableReference() && parameter.Type.
IsRefLikeType
);
1822
if (receiver?.Type?.
IsRefLikeType
== true)
1863
|| (param is null or { RefKind: not RefKind.None, Type.
IsRefLikeType
: true } && isArgumentRefEscape == isRefEscape))
1892
return method is { RefKind: not RefKind.None, ReturnType.
IsRefLikeType
: true };
1981
if (receiver?.Type?.
IsRefLikeType
== true)
2025
|| (param is null or { RefKind: not RefKind.None, Type.
IsRefLikeType
: true } && isArgumentRefEscape == isRefEscape))
2150
parameter.Type.
IsRefLikeType
&&
2263
return method.ContainingType.
IsRefLikeType
;
2266
return method.ReturnType.
IsRefLikeType
;
2268
return property.Type.
IsRefLikeType
;
2326
if (argument.Type?.
IsRefLikeType
== true)
2334
if (parameter.Type.
IsRefLikeType
&& parameter.RefKind != RefKind.Out && GetParameterValEscapeLevel(parameter) is { } valEscapeLevel)
2448
if (receiverType?.
IsRefLikeType
== true && !IsReceiverRefReadOnly(symbol))
2478
&& argument.Type?.
IsRefLikeType
== true)
3485
if (expr.Type?.
IsRefLikeType
!= true)
3570
if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.
IsRefLikeType
)
3892
if (expr.Type?.
IsRefLikeType
!= true)
3995
if (fieldSymbol.IsStatic || !fieldSymbol.ContainingType.
IsRefLikeType
)
Binder\Binder_Expressions.cs (4)
1779
if (refKind != RefKind.None || type.
IsRefLikeType
)
1934
Error(diagnostics, parameter.Type.
IsRefLikeType
? ErrorCode.ERR_AnonDelegateCantUseRefLike : ErrorCode.ERR_AnonDelegateCantUse, node, parameter.Name);
1942
(parameter.RefKind != RefKind.None || parameter.Type.
IsRefLikeType
) &&
1945
Error(diagnostics, parameter.Type.
IsRefLikeType
? ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRefLike : ErrorCode.ERR_UnsupportedPrimaryConstructorParameterCapturingRef, node, parameter.Name);
Binder\Binder_Statements.cs (3)
755
Debug.Assert(expr.Type.
IsRefLikeType
|| hasAwait); // pattern dispose lookup is only valid on ref structs or asynchronous usings
1582
Debug.Assert(leftEscape == rightEscape || op1.Type.
IsRefLikeType
);
1601
if (!hasErrors && op1.Type.
IsRefLikeType
)
Binder\ForEachLoopBinder.cs (2)
1021
if (enumeratorType.
IsRefLikeType
|| isAsync)
1057
if (!enumeratorType.
IsRefLikeType
&& patternDisposeMethod is null)
Binder\RefSafetyAnalysis.cs (3)
439
if (node.DeclaredTypeOpt?.Type.
IsRefLikeType
== true)
507
return typeExpression.Type.
IsRefLikeType
? valEscape : CallingMethodScope;
545
return member.Type.
IsRefLikeType
? valEscape : CallingMethodScope;
Binder\Semantics\Conversions\Conversions.cs (1)
402
if (spanType.TypeKind == TypeKind.Struct && spanType.
IsRefLikeType
)
Binder\UsingStatementBinder.cs (1)
211
if (type is object && (type.
IsRefLikeType
|| hasAwait))
CodeGen\EmitExpression.cs (1)
3734
Debug.Assert(!type.
IsRefLikeType
);
FlowAnalysis\NullableWalker.cs (1)
11007
Debug.Assert(node.Type is null || node.Type.IsErrorType() || node.Type.
IsRefLikeType
);
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
237
_ when variableType.
IsRefLikeType
&& !hasOverriddenToString(variableType)
Symbols\Metadata\PE\PEFieldSymbol.cs (1)
635
(IsFixedSizeBuffer || Type.
IsRefLikeType
== true))
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
321
else if (typeWithAnnotations.Type.
IsRefLikeType
)
Symbols\PublicModel\TypeSymbol.cs (1)
171
bool ITypeSymbol.IsRefLikeType => UnderlyingTypeSymbol.
IsRefLikeType
;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (3)
1391
if (method.ReturnType.
IsRefLikeType
||
1396
else if (parameters.Any(p => (p.RefKind is RefKind.Ref or RefKind.Out) && p.Type.
IsRefLikeType
))
1412
else if (parameters.Any(p => p.RefKind == RefKind.None && p.Type.
IsRefLikeType
))
Symbols\Source\SourceMemberFieldSymbol.cs (2)
66
else if (type.
IsRefLikeType
&& (this.IsStatic || !containingType.IsRefLikeType))
496
if (type.Type?.
IsRefLikeType
== true)
Symbols\Source\SourcePropertySymbolBase.cs (2)
1530
else if (this.IsAutoPropertyWithGetAccessor && type.
IsRefLikeType
&& (this.IsStatic || !this.ContainingType.
IsRefLikeType
))
Symbols\TypeSymbolExtensions.cs (2)
482
return type.IsErrorType() || type.
IsRefLikeType
;
1332
type.
IsRefLikeType
;
Symbols\TypeWithAnnotations.cs (1)
875
internal override bool IsRefLikeType(TypeSymbol typeSymbol) => typeSymbol.
IsRefLikeType
;
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
229
get { return _underlyingType.
IsRefLikeType
; }
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (3)
Attributes\AttributeTests_IsByRefLike.cs (3)
670
Assert.True(type.
IsRefLikeType
);
757
Assert.True(type.
IsRefLikeType
);
808
Assert.True(type.
IsRefLikeType
);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (13)
Parsing\ReadOnlyStructs.cs (13)
45
Assert.False(s1.
IsRefLikeType
);
51
Assert.False(s2.
IsRefLikeType
);
57
Assert.False(s3.
IsRefLikeType
);
119
Assert.False(s1.
IsRefLikeType
);
125
Assert.False(s2.
IsRefLikeType
);
131
Assert.False(s3.
IsRefLikeType
);
154
Assert.True(s1.
IsRefLikeType
);
160
Assert.True(s2.
IsRefLikeType
);
187
Assert.False(s1.
IsRefLikeType
);
191
Assert.True(s2.
IsRefLikeType
);
221
Assert.True(s1.
IsRefLikeType
);
225
Assert.False(s2.
IsRefLikeType
);
229
Assert.True(s3.
IsRefLikeType
);