handzlikchris / handzlikchris/FastScriptReload

'This' rewriting causes some issues with rewritting generic methods

Đang mở
#9 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug user-code-rewrite
Ngôn ngữ chính
C#
Star
2.2k
Fork
167
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

KillerJoe — Yesterday at 20:02
next problem: I have a generic Method "Parent" for the UiElements:

public static T Parent(this T element, VisualElement parent, bool grow = false, int? insertIndex = null) where T : VisualElement {

its changed to ".Parent((dynamic)this)" causing an compile error.

FSR: Error when updating files: 'LoadByUrl.cs', System.Exception: Compiler failed to produce the assembly. Output: 'C:\Users\tfoso\AppData\Local\Temp\3bcdba1c62ed4b1d9e72f62953347396.SourceCodeCombined.cs(222,15): error CS1929: 'HorizontalPanel' does not contain a definition for 'Parent' and the best extension method overload 'VisualElementExtension.Parent(T, VisualElement, bool, int?)' requires a receiver of type 'T'

C:\Users\tfoso\AppData\Local\Temp\3bcdba1c62ed4b1d9e72f62953347396.SourceCodeCombined.cs(259,87): error CS1929: 'I18nLabel' does not contain a definition for 'Parent' and the best extension method overload 'VisualElementExtension.Parent(T, VisualElement, bool, int?)' requires a receiver of type 'T'

[ ] Killer Joe from Discord

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với các lỗi trình biên dịch được báo cáo khi cập nhật LoadByUrl.cs và so sánh lời gọi extension Parent generic ban đầu với dạng được viết lại `.Parent((dynamic)this)`. Theo dõi logic viết lại tạo ra mã nguồn được sinh, sau đó xác minh rằng các lời gọi trên HorizontalPanel và I18nLabel biên dịch mà không có lỗi CS1929.

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

Đánh giá

Công nghệ
csharp, unity
Lĩnh vực
compilers, devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

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.