C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)
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
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ả
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
ParameterizedTypeof 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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodeLaser/maddi
-
build/ci good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug front-end:javac
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
-
Java → C# translation: an idiomatic C# printer driven by the modification and nullability analysesĐang mởenhancement extension front-end:csharp
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
-
enhancement extension front-end:csharp
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Tất cả issue của CodeLaser/maddi
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/rocketmq-dashboard#6896 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenIntegrationEngine/engine#496 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
SasanLabs/VulnerableApp#836 ·
Maintainer thường phản hồi trong vòng 1 ngày