Skip to content

Commit 721db45

Browse files
committed
Fix analyzer for array creation handling and deactivate return handling
1 parent 60718d6 commit 721db45

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/noncopyable_analyzer/NonCopyableAnalyzer.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ public override void Initialize(AnalysisContext context)
5757
CheckCopyability(oc, op.Value, ArgumentRule);
5858
}, OperationKind.Argument);
5959

60-
csc.RegisterOperationAction(oc =>
61-
{
62-
var op = (IReturnOperation)oc.Operation;
63-
if (op.ReturnedValue == null) return;
64-
CheckCopyability(oc, op.ReturnedValue, ReturnRule);
65-
}, OperationKind.Return,
66-
OperationKind.YieldReturn);
60+
// csc.RegisterOperationAction(oc =>
61+
// {
62+
// var op = (IReturnOperation)oc.Operation;
63+
// if (op.ReturnedValue == null) return;
64+
// CheckCopyability(oc, op.ReturnedValue, ReturnRule);
65+
// }, OperationKind.Return,
66+
// OperationKind.YieldReturn);
6767

6868
csc.RegisterOperationAction(oc =>
6969
{
@@ -93,7 +93,7 @@ public override void Initialize(AnalysisContext context)
9393
{
9494
var op = (IArrayInitializerOperation)oc.Operation;
9595

96-
if (!((IArrayTypeSymbol)((IArrayInitializerOperation)op.Parent).Type).ElementType.IsNonCopyable()) return;
96+
if (!((IArrayTypeSymbol)((IArrayCreationOperation)op.Parent).Type).ElementType.IsNonCopyable()) return;
9797

9898
foreach (var v in op.ElementValues)
9999
{

0 commit comments

Comments
 (0)