diff --git a/runtime/CSharp/Antlr4.Runtime/Dfa/DFAState.cs b/runtime/CSharp/Antlr4.Runtime/Dfa/DFAState.cs index 9b115061a..cb23efe86 100644 --- a/runtime/CSharp/Antlr4.Runtime/Dfa/DFAState.cs +++ b/runtime/CSharp/Antlr4.Runtime/Dfa/DFAState.cs @@ -290,7 +290,11 @@ namespace Antlr4.Runtime.Dfa } else { +#if NET_4_5 Dictionary result = map.ToDictionary(i => i.Key, i => i.Value); +#else + Dictionary result = new Dictionary(map); +#endif result.Add(PredictionContext.EmptyFullStateKey, result[-1]); result.Remove(-1); #if NET_4_5