Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyTs authored Mar 22, 2024
1 parent c0f4f12 commit 77f93d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ public MethodSymbol WellKnownMethod(WellKnownMember wm)
/// <returns>A symbol for the special member.</returns>
public Symbol SpecialMember(SpecialMember sm)
{
return SpecialMember(sm, isOptional: false)!;
var result = SpecialMember(sm, isOptional: false);
Debug.Assert(result is not null);
return result;
}

public Symbol? SpecialMember(SpecialMember sm, bool isOptional = false)
Expand Down Expand Up @@ -437,7 +439,9 @@ public Symbol SpecialMember(SpecialMember sm)

public MethodSymbol SpecialMethod(SpecialMember sm)
{
return (MethodSymbol)SpecialMember(sm, isOptional: false)!;
var result = (MethodSymbol)SpecialMember(sm, isOptional: false);

Check failure on line 442 in src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs

View check run for this annotation

Azure Pipelines / roslyn-CI (Unix_Build Build_Unix_Debug)

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs#L442

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs(442,26): error CS8600: (NETCORE_ENGINEERING_TELEMETRY=Build) Converting null literal or possible null value to non-nullable type.

Check failure on line 442 in src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs

View check run for this annotation

Azure Pipelines / roslyn-CI (Unix_Build Build_Unix_Debug)

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs#L442

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs(442,26): error CS8600: (NETCORE_ENGINEERING_TELEMETRY=Build) Converting null literal or possible null value to non-nullable type.

Check failure on line 442 in src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs

View check run for this annotation

Azure Pipelines / roslyn-CI (Correctness Correctness_Analyzers)

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs#L442

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs(442,26): error CS8600: (NETCORE_ENGINEERING_TELEMETRY=Build) Converting null literal or possible null value to non-nullable type.

Check failure on line 442 in src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs

View check run for this annotation

Azure Pipelines / roslyn-CI (Correctness Correctness_Analyzers)

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs#L442

src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs(442,26): error CS8600: (NETCORE_ENGINEERING_TELEMETRY=Build) Converting null literal or possible null value to non-nullable type.
Debug.Assert(result is not null);
return result;
}

public MethodSymbol? SpecialMethod(SpecialMember sm, bool isOptional)
Expand Down
6 changes: 0 additions & 6 deletions src/Compilers/Core/Portable/ExtendedSpecialType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ private ExtendedSpecialType(int value)
public static explicit operator ExtendedSpecialType(int value) => new ExtendedSpecialType(value);
public static explicit operator int(ExtendedSpecialType value) => value._value;

public static bool operator ==(ExtendedSpecialType left, SpecialType right) => left._value == (byte)right;
public static bool operator !=(ExtendedSpecialType left, SpecialType right) => !(left == right);

public static bool operator ==(SpecialType left, ExtendedSpecialType right) => right == left;
public static bool operator !=(SpecialType left, ExtendedSpecialType right) => right != left;

public static bool operator ==(ExtendedSpecialType left, ExtendedSpecialType right) => left._value == right._value;
public static bool operator !=(ExtendedSpecialType left, ExtendedSpecialType right) => !(left == right);

Expand Down

0 comments on commit 77f93d3

Please sign in to comment.