Example #1
0
        // Not thread-safe.
        internal PlaceholderMethodSymbol GetOrAddSynthesizedMethod(string methodName, CreateSynthesizedMethod factory)
        {
#if DEBUG
            Debug.Assert(!_sealed);
#endif
            if (_lazySynthesizedMethods == null)
            {
                _lazySynthesizedMethods = new Dictionary <string, PlaceholderMethodSymbol>();
            }
            PlaceholderMethodSymbol method;
            if (!_lazySynthesizedMethods.TryGetValue(methodName, out method))
            {
                method = factory(this, methodName, _syntax);
                Debug.Assert((object)method != null);
                Debug.Assert(method.Name == methodName);
                _lazySynthesizedMethods.Add(methodName, method);
            }
            return(method);
        }
Example #2
0
        // Not thread-safe.
        internal PlaceholderMethodSymbol GetOrAddSynthesizedMethod(string methodName, CreateSynthesizedMethod factory)
        {
#if DEBUG
            Debug.Assert(!_sealed);
#endif
            if (_lazySynthesizedMethods == null)
            {
                _lazySynthesizedMethods = new Dictionary<string, PlaceholderMethodSymbol>();
            }
            PlaceholderMethodSymbol method;
            if (!_lazySynthesizedMethods.TryGetValue(methodName, out method))
            {
                method = factory(this, methodName, _syntax);
                Debug.Assert((object)method != null);
                Debug.Assert(method.Name == methodName);
                _lazySynthesizedMethods.Add(methodName, method);
            }
            return method;
        }