handzlikchris / handzlikchris/FastScriptReload

The BuilderPatternFunctionsRewriter class has some incorrect handling methods.

Abierto
#145 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
C#
Estrellas
2.2k
Forks
167
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

orgin code is:
` private static ClassA staicField;

public static ClassA GetStaicField()
{
return staicField;
}`

will be written to
` private static ClassA staicField;

public static ClassA_Patched_0 GetStaicField()
{
return staicField;
}`

The above code may lead to type mismatch errors.

Only "return this" needs to be rewrite. Perhaps it is necessary to add a check for whether there is a "return this".

static bool ReturnsThis(MethodDeclarationSyntax method)
{
var returnStatements = method.DescendantNodes().OfType();

return returnStatements.All(r => r.Expression is ThisExpressionSyntax);
}

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start in the BuilderPatternFunctionsRewriter class and inspect how it handles method return types and return statements. Reproduce the shown static getter case, then verify that only methods returning this are rewritten and that the generated code has no type mismatch.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.