Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)

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

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
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp, java
Lĩnh vực
compilers

Hướng nghiên cứu

The fix spans two places the payload names: the front end, where the ParameterizedType of an inner class use must carry the outer type's arguments (javac keeps them on the ClassType's enclosing type), and the C# printer, which currently writes ElementAwareArrayList.Entry. Start by reproducing the Holder.Store<T>.Entry sample and checking the printed output of private Store<String>.Entry cached;. Done means it prints Holder.Store<string>.Entry and a nested type inside Store<T> stays simple, with no CS0426 in the timefold cases.

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

Mô tả

front-end:csharp

Problem

A class nested in a generic class, used from outside it, needs the outer class's type arguments in C#: Java's
ElementAwareArrayList<Mapped_>.Entry is C#'s ElementAwareArrayList<Mapped_>.Entry. The CST's ParameterizedType
of Entry does not carry the outer type's arguments, so the C# printer writes ElementAwareArrayList.Entry, which
names the non-generic companion class of the static members, where there is no Entry (CS0426).

In timefold this is 5 errors (AbstractToListSlot, AbstractToCollectionSlot, AbstractLeftDatasetInstance,
RandomAccessLeafIndexer). A smaller sample:

public class Holder {
    static final class Store<T> {
        final class Entry { }
        Entry add(T value) { return new Entry(); }
    }
    private Store<String>.Entry cached;
    void keep(Store<String> store) { cached = store.add("x"); }
}

prints private Holder.Store.Entry cached; (wanted: Holder.Store<string>.Entry), and also qualifies Entry
inside Store<T> itself as Holder.Store.Entry, where plain Entry (or Store<T>.Entry) would do.

What is needed

  • front end: the outer type's arguments on the ParameterizedType of an inner class's use (javac has them on the
    ClassType's enclosing type);
  • C# printer: print them, Outer<A>.Inner, and inside the generic class leave a nested type simple.

Part of #115.

Ngôn ngữ chính
Java
Star
1
Fork
1
Merge trung bình
1 giờ 58 phút
Pull request đã merge (30 ngày)
5

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.