Пример #1
0
 private void ReportMissingStateMachineAttribute(DiagnosticBag diagnostics, IMethodSymbolInternal method, string stateMachineAttributeFullName)
 {
     diagnostics.Add(MessageProvider.CreateDiagnostic(
                         MessageProvider.ERR_EncUpdateFailedMissingAttribute,
                         method.Locations.First(),
                         MessageProvider.GetErrorDisplayString(method.GetISymbol()),
                         stateMachineAttributeFullName));
 }
Пример #2
0
        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);
        }
Пример #3
0
        private static string GetMethodName(IMethodSymbolInternal methodSymbol)
        {
            IMethodSymbol iMethod = (IMethodSymbol)methodSymbol.GetISymbol();
            var           format  = (iMethod.MethodKind == MethodKind.UserDefinedOperator) ?
                                    _testDataOperatorKeyFormat :
                                    _testDataKeyFormat;

            return(iMethod.ToDisplayString(format));
        }
Пример #4
0
        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);
        }