Browse Source

Fix bug that caused the wrong part to be removed from a compound class.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
ea42e6354b
  1. 3
      ICSharpCode.NRefactory.VB.Tests/ICSharpCode.NRefactory.VB.Tests.csproj
  2. 9
      ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleProjectContent.cs
  3. 11
      NRefactory.sln

3
ICSharpCode.NRefactory.VB.Tests/ICSharpCode.NRefactory.VB.Tests.csproj

@ -62,8 +62,7 @@ @@ -62,8 +62,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\Mono.Cecil\Test\libs\nunit-2.4.8\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">

9
ICSharpCode.NRefactory/TypeSystem/Implementation/SimpleProjectContent.cs

@ -129,8 +129,13 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation @@ -129,8 +129,13 @@ namespace ICSharpCode.NRefactory.TypeSystem.Implementation
if (compoundTypeDef != null) {
// Remove one part from a compound class
var newParts = new List<ITypeDefinition>(compoundTypeDef.GetParts());
if (newParts.Remove(typeDefinition)) {
((DefaultTypeDefinition)typeDefinition).SetCompoundTypeDefinition(typeDefinition);
// We cannot use newParts.Remove() because we need to use reference equality
for (int i = 0; i < newParts.Count; i++) {
if (newParts[i] == typeDefinition) {
newParts.RemoveAt(i);
((DefaultTypeDefinition)typeDefinition).SetCompoundTypeDefinition(typeDefinition);
break;
}
}
types.UpdateType(CompoundTypeDefinition.Create(newParts));
} else {

11
NRefactory.sln

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.1.0.7854-beta
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DC98210E-1646-483B-819A-2BB8272461E4}"
ProjectSection(SolutionItems) = preProject
README = README
@ -13,8 +14,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Test @@ -13,8 +14,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Test
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.VB", "ICSharpCode.NRefactory.VB\ICSharpCode.NRefactory.VB.csproj", "{7B82B671-419F-45F4-B778-D9286F996EFA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.VB.Tests", "ICSharpCode.NRefactory.VB.Tests\ICSharpCode.NRefactory.VB.Tests.csproj", "{870115DD-960A-4406-A6B9-600BCDC36A03}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "..\Mono.Cecil\Mono.Cecil.csproj", "{D68133BD-1E63-496E-9EDE-4FBDBF77B486}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Demo", "ICSharpCode.NRefactory.Demo\ICSharpCode.NRefactory.Demo.csproj", "{9C19E629-C93E-4ACB-9A4B-13072B5AEF9D}"
@ -53,14 +52,6 @@ Global @@ -53,14 +52,6 @@ Global
{7B82B671-419F-45F4-B778-D9286F996EFA}.Release|Any CPU.Build.0 = Release|Any CPU
{7B82B671-419F-45F4-B778-D9286F996EFA}.Release|x86.ActiveCfg = Release|Any CPU
{7B82B671-419F-45F4-B778-D9286F996EFA}.Release|x86.Build.0 = Release|Any CPU
{870115DD-960A-4406-A6B9-600BCDC36A03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{870115DD-960A-4406-A6B9-600BCDC36A03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{870115DD-960A-4406-A6B9-600BCDC36A03}.Debug|x86.ActiveCfg = Debug|x86
{870115DD-960A-4406-A6B9-600BCDC36A03}.Debug|x86.Build.0 = Debug|x86
{870115DD-960A-4406-A6B9-600BCDC36A03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{870115DD-960A-4406-A6B9-600BCDC36A03}.Release|Any CPU.Build.0 = Release|Any CPU
{870115DD-960A-4406-A6B9-600BCDC36A03}.Release|x86.ActiveCfg = Release|x86
{870115DD-960A-4406-A6B9-600BCDC36A03}.Release|x86.Build.0 = Release|x86
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.ActiveCfg = net_4_0_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|Any CPU.Build.0 = net_4_0_Debug|Any CPU
{D68133BD-1E63-496E-9EDE-4FBDBF77B486}.Debug|x86.ActiveCfg = net_4_0_Debug|Any CPU

Loading…
Cancel
Save