handzlikchris / handzlikchris/FastScriptReload

'This' rewriting causes some issues with rewritting generic methods

Ouverte
#9 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug user-code-rewrite
Langage dominant
C#
Étoiles
2.2k
Forks
167
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start with the compiler errors reported while updating LoadByUrl.cs and compare the original generic Parent extension call with its rewritten `.Parent((dynamic)this)` form. Trace the rewriting logic that produces the generated source, then verify that calls on HorizontalPanel and I18nLabel compile without the CS1929 errors.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp, unity
Domaine
compilers, devtools
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.