Fix baselines.

上级 388cc58a
......@@ -9022,9 +9022,9 @@ class Derived : Base
// (8,26): error CS0115: 'Derived.Goo<T>(T)': no suitable method found to override
// public override void Goo<T>(T value) where T : struct, class { }
Diagnostic(ErrorCode.ERR_OverrideNotExpected, "Goo").WithArguments("Derived.Goo<T>(T)").WithLocation(8, 26),
// (8,60): error CS8869: The 'class' constraint cannot be combined with the 'struct' constraint
// (8,60): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public override void Goo<T>(T value) where T : struct, class { }
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(8, 60));
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "class").WithLocation(8, 60));
}
[Fact]
......@@ -9044,9 +9044,9 @@ class Derived : Base
// (8,26): error CS0115: 'Derived.Goo<T>(T)': no suitable method found to override
// public override void Goo<T>(T value) where T : class, struct { }
Diagnostic(ErrorCode.ERR_OverrideNotExpected, "Goo").WithArguments("Derived.Goo<T>(T)").WithLocation(8, 26),
// (8,59): error CS8869: The 'struct' constraint cannot be combined with the 'class' constraint
// (8,59): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public override void Goo<T>(T value) where T : class, struct { }
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(8, 59));
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "struct").WithLocation(8, 59));
}
[Fact]
......@@ -9064,9 +9064,9 @@ class Derived : Base
}
";
var comp = CreateCompilation(source).VerifyDiagnostics(
// (9,60): error CS8869: The 'class' constraint cannot be combined with the 'struct' constraint
// (9,60): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public override void Goo<T>(T value) where T : struct, class { }
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(9, 60));
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "class").WithLocation(9, 60));
}
[Fact]
......@@ -9086,10 +9086,9 @@ class C : I
// (8,12): error CS0539: 'C.Goo<T>(T)' in explicit interface declaration is not found among members of the interface that can be implemented
// void I.Goo<T>(T value) where T : struct, class { }
Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "Goo").WithArguments("C.Goo<T>(T)").WithLocation(8, 12),
// (8,46): error CS8869: The 'class' constraint cannot be combined with the 'struct' constraint
// (8,46): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// void I.Goo<T>(T value) where T : struct, class { }
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(8, 46)
);
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "class").WithLocation(8, 46));
}
[Fact]
......@@ -9109,9 +9108,9 @@ class C : I
// (8,12): error CS0539: 'C.Goo<T>(T)' in explicit interface declaration is not found among members of the interface that can be implemented
// void I.Goo<T>(T value) where T : class, struct { }
Diagnostic(ErrorCode.ERR_InterfaceMemberNotFound, "Goo").WithArguments("C.Goo<T>(T)").WithLocation(8, 12),
// (8,45): error CS8869: The 'struct' constraint cannot be combined with the 'class' constraint
// (8,45): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// void I.Goo<T>(T value) where T : class, struct { }
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(8, 45));
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "struct").WithLocation(8, 45));
}
[Fact]
......@@ -9129,9 +9128,9 @@ class C : I
}
";
var comp = CreateCompilation(source).VerifyDiagnostics(
// (9,46): error CS8869: The 'class' constraint cannot be combined with the 'struct' constraint
// (9,46): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// void I.Goo<T>(T value) where T : struct, class { }
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(9, 46));
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "class").WithLocation(9, 46));
}
[Fact]
......
......@@ -81660,10 +81660,10 @@ class B
comp.VerifyDiagnostics(
// (8,59): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public static void F2<T2>(T2? t2) where T2 : notnull, struct
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(8, 59),
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "struct").WithLocation(8, 59),
// (4,58): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public static void F1<T1>(T1? t1) where T1 : struct, notnull
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(4, 58)
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "notnull").WithLocation(4, 58)
);
var m = comp.SourceModule;
......@@ -81704,10 +81704,10 @@ class B
comp.VerifyDiagnostics(
// (4,57): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public static void F1<T1>(T1? t1) where T1 : class, notnull
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(4, 57),
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "notnull").WithLocation(4, 57),
// (8,59): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public static void F2<T2>(T2? t2) where T2 : notnull, class
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(8, 59)
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "class").WithLocation(8, 59)
);
var m = comp.SourceModule;
......@@ -81749,10 +81749,10 @@ class B
comp.VerifyDiagnostics(
// (4,58): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public static void F1<T1>(T1? t1) where T1 : class?, notnull
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(4, 58),
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "notnull").WithLocation(4, 58),
// (8,59): error CS0449: The 'class', 'struct', 'unmanaged', and 'notnull' constraints cannot be combined or duplicated, and must be specified first in the constraints list.
// public static void F2<T2>(T2? t2) where T2 : notnull, class?
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst).WithLocation(8, 59)
Diagnostic(ErrorCode.ERR_TypeConstraintsMustBeUniqueAndFirst, "class").WithLocation(8, 59)
);
var m = comp.SourceModule;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册