Skip to content

Commit

Permalink
[CS0618] GraphDslCompileSpec - Warning Disable (#6680)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaba authored May 4, 2023
1 parent 502370e commit 4b19cd1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/core/Akka.Streams.Tests/Dsl/GraphDslCompileSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,46 @@ private class Apple : IFruit

}

#pragma warning disable CS0618 // Type or member is obsolete
private sealed class OpStage<TIn, TOut> : PushStage<TIn, TOut> where TIn : TOut
#pragma warning restore CS0618 // Type or member is obsolete
{
public override ISyncDirective OnPush(TIn element, IContext<TOut> context)
{
return context.Push(element);
}
}

#pragma warning disable CS0618 // Type or member is obsolete
private static IStage<TIn, TOut> Op<TIn, TOut>() where TIn : TOut => new OpStage<TIn, TOut>();
#pragma warning restore CS0618 // Type or member is obsolete

private static IEnumerator<Apple> Apples() => Enumerable.Repeat(new Apple(), int.MaxValue).GetEnumerator();

private static Flow<string, string, NotUsed> F1
#pragma warning disable CS0618 // Type or member is obsolete
=> Flow.Create<string>().Transform(Op<string, string>).Named("F1");
#pragma warning restore CS0618 // Type or member is obsolete
private static Flow<string, string, NotUsed> F2
#pragma warning disable CS0618 // Type or member is obsolete
=> Flow.Create<string>().Transform(Op<string, string>).Named("F2");
#pragma warning restore CS0618 // Type or member is obsolete
private static Flow<string, string, NotUsed> F3
#pragma warning disable CS0618 // Type or member is obsolete
=> Flow.Create<string>().Transform(Op<string, string>).Named("F3");
#pragma warning restore CS0618 // Type or member is obsolete
private static Flow<string, string, NotUsed> F4
#pragma warning disable CS0618 // Type or member is obsolete
=> Flow.Create<string>().Transform(Op<string, string>).Named("F4");
#pragma warning restore CS0618 // Type or member is obsolete
private static Flow<string, string, NotUsed> F5
#pragma warning disable CS0618 // Type or member is obsolete
=> Flow.Create<string>().Transform(Op<string, string>).Named("F5");
#pragma warning restore CS0618 // Type or member is obsolete
private static Flow<string, string, NotUsed> F6
#pragma warning disable CS0618 // Type or member is obsolete
=> Flow.Create<string>().Transform(Op<string, string>).Named("F6");
#pragma warning restore CS0618 // Type or member is obsolete

private static Source<string, NotUsed> In1 => Source.From(new[] { "a", "b", "c" });
private static Source<string, NotUsed> In2 => Source.From(new[] { "d", "e", "f" });
Expand Down Expand Up @@ -227,8 +243,10 @@ public void A_Graph_should_build_wikipedia_Topological_sorting()
var out2 = Sink.AsPublisher<string>(false).MapMaterializedValue(_ => NotUsed.Instance);
var out9 = Sink.AsPublisher<string>(false).MapMaterializedValue(_ => NotUsed.Instance);
var out10 = Sink.AsPublisher<string>(false).MapMaterializedValue(_ => NotUsed.Instance);
#pragma warning disable CS0618 // Type or member is obsolete
Func<string, Flow<string, string, NotUsed>> f =
s => Flow.Create<string>().Transform(Op<string, string>).Named(s);
#pragma warning restore CS0618 // Type or member is obsolete

b.From(in7).Via(f("a")).Via(b7).Via(f("b")).Via(m11).Via(f("c")).Via(b11).Via(f("d")).To(out2);
b.From(b11).Via(f("e")).Via(m9).Via(f("f")).To(out9);
Expand Down

0 comments on commit 4b19cd1

Please sign in to comment.