Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions src/NonCopyable.sln
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2003
# Visual Studio Version 17
VisualStudioVersion = 17.6.33829.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NonCopyable", "NonCopyable\NonCopyable\NonCopyable.csproj", "{CC552C73-1EA3-457B-8E98-2D5D3213C5C5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NonCopyable", "NonCopyable\NonCopyable\NonCopyable.csproj", "{CC552C73-1EA3-457B-8E98-2D5D3213C5C5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NonCopyable.Test", "NonCopyable\NonCopyable.Test\NonCopyable.Test.csproj", "{88F29EA0-BB85-4E16-AF40-E48B69085017}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NonCopyable.Test", "NonCopyable\NonCopyable.Test\NonCopyable.Test.csproj", "{88F29EA0-BB85-4E16-AF40-E48B69085017}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NonCopyable.Vsix", "NonCopyable\NonCopyable.Vsix\NonCopyable.Vsix.csproj", "{6830D342-6930-43F8-AA43-2E222DE700E2}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NonCopyable.Vsix", "NonCopyable\NonCopyable.Vsix\NonCopyable.Vsix.csproj", "{82193301-CA7B-41C0-BCEF-01503E0A15EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NonCopyable.TestTypes", "NonCopyable\NonCopyable.TestTypes\NonCopyable.TestTypes.csproj", "{D3F9BFB6-63A3-4E36-A2DC-86D5AC16DBE2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -23,10 +25,14 @@ Global
{88F29EA0-BB85-4E16-AF40-E48B69085017}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88F29EA0-BB85-4E16-AF40-E48B69085017}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88F29EA0-BB85-4E16-AF40-E48B69085017}.Release|Any CPU.Build.0 = Release|Any CPU
{6830D342-6930-43F8-AA43-2E222DE700E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6830D342-6930-43F8-AA43-2E222DE700E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6830D342-6930-43F8-AA43-2E222DE700E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6830D342-6930-43F8-AA43-2E222DE700E2}.Release|Any CPU.Build.0 = Release|Any CPU
{82193301-CA7B-41C0-BCEF-01503E0A15EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82193301-CA7B-41C0-BCEF-01503E0A15EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82193301-CA7B-41C0-BCEF-01503E0A15EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82193301-CA7B-41C0-BCEF-01503E0A15EB}.Release|Any CPU.Build.0 = Release|Any CPU
{D3F9BFB6-63A3-4E36-A2DC-86D5AC16DBE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3F9BFB6-63A3-4E36-A2DC-86D5AC16DBE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3F9BFB6-63A3-4E36-A2DC-86D5AC16DBE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3F9BFB6-63A3-4E36-A2DC-86D5AC16DBE2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
"path": "Class1.csx",
"message-args": [ "T" ]
},
{
"id": "NoCopy05",
"sevirity": "Error",
"line": 33,
"column": 16,
"path": "Class1.csx",
"message-args": [ "T" ]
},
{
"id": "NoCopy04",
"sevirity": "Error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static class Ex1
public static T Constraint<[NonCopyable] T>(ref this T x) where T : struct
{
var t = x; // ❌
return t; // ❌
return t;
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/NonCopyable/NonCopyable.Test/NonCopyable.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NonCopyable\NonCopyable.csproj" />
<ProjectReference Include="..\NonCopyable.TestTypes\NonCopyable.TestTypes.csproj" />
<ProjectReference Include="..\NonCopyable\NonCopyable.csproj">
<OutputItemType>Analyzer</OutputItemType>
</ProjectReference>
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties /></VisualStudio></ProjectExtensions>
Expand Down
8 changes: 7 additions & 1 deletion src/NonCopyable/NonCopyable.Test/NonCopyable.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.Reflection;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using NonCopyable.Test.TestTypes;
using TestHelper;
using Xunit;

Expand Down Expand Up @@ -36,7 +38,11 @@ protected override IEnumerable<MetadataReference> References
get
{
foreach (var r in base.References) yield return r;
yield return MetadataReference.CreateFromFile(GetType().Assembly.Location);
yield return MetadataReference.CreateFromFile(typeof(MyNonCopyable).Assembly.Location);
foreach(var name in typeof(MyNonCopyable).Assembly.GetReferencedAssemblies())
{
yield return MetadataReference.CreateFromFile(Assembly.Load(name).Location);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions src/NonCopyable/NonCopyable/NonCopyable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Allow usage of non-copyable in conditional expressions (? :).
Treat return statement as having move semantics for locals and parameters.</PackageReleaseNotes>
<PackageTags>NonCopyable, analyzers</PackageTags>
<NoPackageAnalysis>true</NoPackageAnalysis>
<IsRoslynComponent>true</IsRoslynComponent>
</PropertyGroup>

<ItemGroup>
Expand Down