C# printer: nine unit-test samples that Roslyn rejects

Đang mở
#185 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
61/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, java
Lĩnh vực
devtools, testing

Hướng nghiên cứu

Read the listed TestJavaToCSharpStructure and TestJavaToCSharpBcl samples, then run the C# printer unit tests with CSharpCheck via tools/csharp-check -serve. Fix each remaining printer bug identified by the Roslyn errors and remove its compile = false marker; the issue is done when all samples compile. The inherited-family test fault is already fixed.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

The C# printer's unit tests now have Roslyn judge every sample (CommonJavaToCSharp.translate, CSharpCheck on tools/csharp-check -serve). On the first run, 9 of 131 samples do not compile. Each test sets compile = false with a pointer here until its printer bug is fixed; this issue closes when none is left.

  • TestJavaToCSharpStructure.conditionalVars: var node = c ? new IndexedExists<A, B>() : new UnindexedExists<A, string>() — CS0173, C# finds no common type for a conditional of two sibling classes; Java's is the common supertype (declare it, or cast one branch).
  • TestJavaToCSharpStructure.innerClasses: Upcoming : IJavaIterator<long> with long? Next() — CS0738, the boxed Long next() must override as long, as it does for a top-level class.
  • TestJavaToCSharpStructure.localClasses: a local class that captures (Adder) is referenced but not printed anywhere — CS0246.
  • TestJavaToCSharpStructure.longTypeArguments: a cast through a wildcard printed as object — CS0030 (the wildcard family).
  • TestJavaToCSharpStructure.suppliers: sealed class Defaults<R> where R : Defaults<R> — CS0701, a class that is a type parameter's bound cannot be sealed.
  • TestJavaToCSharpStructure.tryWithResources: System.gc() unmapped (GC.Collect()).
  • TestJavaToCSharpStructure.wildcardInterfaces: the wildcard interface IImpacter and the companion static class IImpacter of IImpacter<G> clash — CS0102.
  • TestJavaToCSharpBcl.navigation: three errors in one sample: T[] ToArray<T>(T[] a) => items.ToArray() (CS0029, E[] to T[]), !Contains(v) && items.Add(v) where Add is void on a HashSet-backed ICollection (CS0019), and c.All(...) on the non-generic ICollection (CS1061).
  • TestJavaToCSharpFacts.inheritedFamilyAndStructs was the test's own fault (a package-private method implementing an interface method is not Java either) and is fixed.
Ngôn ngữ chính
Java
Star
1
Fork
1
Merge trung bình
1 giờ 13 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CodeLaser/maddi

Tất cả issue của CodeLaser/maddi

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.