From 33725e3f829f37d7319c1b0b7448bc92d6a1e4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Reis?= Date: Sat, 27 Apr 2013 21:00:47 +0100 Subject: [PATCH] Prevent UseExplicitTypeAction for anonymous types. --- .../Refactoring/CodeActions/UseExplicitTypeAction.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/UseExplicitTypeAction.cs b/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/UseExplicitTypeAction.cs index bc6ffc85f5..0abf8263c9 100644 --- a/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/UseExplicitTypeAction.cs +++ b/ICSharpCode.NRefactory.CSharp/Refactoring/CodeActions/UseExplicitTypeAction.cs @@ -52,7 +52,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring node = foreachStatement; } - if (!(!type.Equals(SpecialType.NullType) && !type.Equals(SpecialType.UnknownType))) { + if (!(!type.Equals(SpecialType.NullType) && !type.Equals(SpecialType.UnknownType) && type.Kind != TypeKind.Anonymous)) { yield break; } yield return new CodeAction (context.TranslateString("Use explicit type"), script => {