提交 a2bffa1d 编写于 作者: C Charles Stoner

PR feedback

上级 1ae01176
......@@ -137,7 +137,7 @@ internal class MemberSignatureComparer : IEqualityComparer<Symbol>
considerTypeConstraints: false,
considerCallingConvention: false,
considerRefKindDifferences: true,
typeComparison: TypeCompareKind.ConsiderEverything);
typeComparison: TypeCompareKind.ObliviousNullableModifierMatchesAny);
/// <summary>
/// This instance is used to check whether one member overrides another, according to the C# definition.
......
......@@ -3087,28 +3087,28 @@ partial class C
public partial string M3();
public partial string? M3() => null; // 3
public partial string? M4();
public partial string M4() => ""hello""; // 4
public partial string? M4(); // 4
public partial string M4() => ""hello"";
#nullable enable
public partial string M5();
public partial string M6() => null!; // 5
public partial string M6() => null!;
public partial string M7();
public partial string M8() => null!; // 6
public partial string M8() => null!; // 5
public partial string? M9();
public partial string? M10() => null; // 7
public partial string? M10() => null;
public partial string? M11();
public partial string? M12() => null;
#nullable disable
public partial string M5() => null; // 8
public partial string M5() => null;
public partial string M6();
public partial string? M7() => null; // 9
public partial string? M8();
public partial string M9() => null; // 10
public partial string? M7() => null; // 6
public partial string? M8(); // 7
public partial string M9() => null;
public partial string M10();
public partial string? M11() => null;
public partial string? M12();
public partial string? M11() => null; // 8
public partial string? M12(); // 9
}";
var comp = CreateCompilation(source, parseOptions: TestOptions.RegularWithExtendedPartialMethods);
comp.VerifyDiagnostics(
......@@ -3119,19 +3119,19 @@ partial class C
// public partial string? M3() => null; // 3
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(13, 26),
// (15,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M4();
// public partial string? M4(); // 4
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(15, 26),
// (31,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M7() => null; // 9
// public partial string? M7() => null; // 6
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(31, 26),
// (32,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M8();
// public partial string? M8(); // 7
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(32, 26),
// (35,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M11() => null;
// public partial string? M11() => null; // 8
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(35, 26),
// (36,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M12();
// public partial string? M12(); // 9
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(36, 26));
comp = CreateCompilation(source, options: TestOptions.ReleaseDllWithWarningLevel5, parseOptions: TestOptions.RegularWithExtendedPartialMethods);
......@@ -3145,41 +3145,23 @@ partial class C
// (13,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M3() => null; // 3
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(13, 26),
// (13,28): warning CS8824: Partial method declarations 'string C.M3()' and 'string? C.M3()' have differences in parameter or return types.
// public partial string? M3() => null; // 3
Diagnostic(ErrorCode.WRN_PartialMethodTypeDifference, "M3").WithArguments("string C.M3()", "string? C.M3()").WithLocation(13, 28),
// (15,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M4();
// public partial string? M4(); // 4
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(15, 26),
// (16,27): warning CS8824: Partial method declarations 'string? C.M4()' and 'string C.M4()' have differences in parameter or return types.
// public partial string M4() => "hello"; // 4
Diagnostic(ErrorCode.WRN_PartialMethodTypeDifference, "M4").WithArguments("string? C.M4()", "string C.M4()").WithLocation(16, 27),
// (20,27): warning CS8824: Partial method declarations 'string C.M6()' and 'string C.M6()' have differences in parameter or return types.
// public partial string M6() => null!; // 5
Diagnostic(ErrorCode.WRN_PartialMethodTypeDifference, "M6").WithArguments("string C.M6()", "string C.M6()").WithLocation(20, 27),
// (22,27): warning CS8824: Partial method declarations 'string? C.M8()' and 'string C.M8()' have differences in parameter or return types.
// public partial string M8() => null!; // 6
// public partial string M8() => null!; // 5
Diagnostic(ErrorCode.WRN_PartialMethodTypeDifference, "M8").WithArguments("string? C.M8()", "string C.M8()").WithLocation(22, 27),
// (24,28): warning CS8824: Partial method declarations 'string C.M10()' and 'string? C.M10()' have differences in parameter or return types.
// public partial string? M10() => null; // 7
Diagnostic(ErrorCode.WRN_PartialMethodTypeDifference, "M10").WithArguments("string C.M10()", "string? C.M10()").WithLocation(24, 28),
// (29,27): warning CS8824: Partial method declarations 'string C.M5()' and 'string C.M5()' have differences in parameter or return types.
// public partial string M5() => null; // 8
Diagnostic(ErrorCode.WRN_PartialMethodTypeDifference, "M5").WithArguments("string C.M5()", "string C.M5()").WithLocation(29, 27),
// (31,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M7() => null; // 9
// public partial string? M7() => null; // 6
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(31, 26),
// (32,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M8();
// public partial string? M8(); // 7
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(32, 26),
// (33,27): warning CS8824: Partial method declarations 'string? C.M9()' and 'string C.M9()' have differences in parameter or return types.
// public partial string M9() => null; // 10
Diagnostic(ErrorCode.WRN_PartialMethodTypeDifference, "M9").WithArguments("string? C.M9()", "string C.M9()").WithLocation(33, 27),
// (35,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M11() => null;
// public partial string? M11() => null; // 8
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(35, 26),
// (36,26): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context.
// public partial string? M12();
// public partial string? M12(); // 9
Diagnostic(ErrorCode.WRN_MissingNonNullTypesContextForAnnotation, "?").WithLocation(36, 26));
}
......
......@@ -378,8 +378,10 @@ public override string ToString()
sb.Append('"');
}
sb.Append(", isSuppressed: ");
sb.Append(_isSuppressed ? "true" : "false");
if (_isSuppressed)
{
sb.Append(", isSuppressed: true");
}
sb.Append(")");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册