private void ReportMissingStateMachineAttribute(DiagnosticBag diagnostics, IMethodSymbolInternal method, string stateMachineAttributeFullName) { diagnostics.Add(MessageProvider.CreateDiagnostic( MessageProvider.ERR_EncUpdateFailedMissingAttribute, method.Locations.First(), MessageProvider.GetErrorDisplayString(method.GetISymbol()), stateMachineAttributeFullName)); }
public void SetMethodBody(IMethodSymbolInternal methodSymbol, Cci.IMethodBody body) { Debug.Assert(methodSymbol.ContainingModule == CommonSourceModule); Debug.Assert(methodSymbol.IsDefinition); Debug.Assert(((IMethodSymbol)methodSymbol.GetISymbol()).PartialDefinitionPart == null); // Must be definition. Debug.Assert(body == null || (object)methodSymbol == body.MethodDefinition); _methodBodyMap.Add(methodSymbol, body); }
private static string GetMethodName(IMethodSymbolInternal methodSymbol) { IMethodSymbol iMethod = (IMethodSymbol)methodSymbol.GetISymbol(); var format = (iMethod.MethodKind == MethodKind.UserDefinedOperator) ? _testDataOperatorKeyFormat : _testDataKeyFormat; return(iMethod.ToDisplayString(format)); }
internal Cci.IMethodBody GetMethodBody(IMethodSymbolInternal methodSymbol) { Debug.Assert(methodSymbol.ContainingModule == CommonSourceModule); Debug.Assert(methodSymbol.IsDefinition); Debug.Assert(((IMethodSymbol)methodSymbol.GetISymbol()).PartialDefinitionPart == null); // Must be definition. Cci.IMethodBody body; if (_methodBodyMap.TryGetValue(methodSymbol, out body)) { return(body); } return(null); }