Regex sourcegen fails with CS0759 when member inside file scoped class
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
The payload gives a reproduction using the GeneratedRegex attribute on a partial method inside a static file partial class, which produces CS0759. Start by reproducing it with that snippet and finding where the regex source generator emits the partial method implementation. Done means a clearer diagnostic for file-scoped containing types, or a documented limitation, with a test covering the case.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
like for #57880 the regex source generator errors out with "No defining declaration found for implementing declaration of partial method", which is technically right, just that maybe a more to the point error message could help finding out that this can't work with a file scoped class
Reproduction Steps
static file partial class sfpc
{
[GeneratedRegex("[^a-zA-Z0-9\\.\\-_]", RegexOptions.Compiled | RegexOptions.ECMAScript)]
private static partial Regex GetSanitizeRx();
}
Expected behavior
warn user about file scoped class
Actual behavior
error CS0759
Regression?
i don't think so, it's the same on net7 and net10
Known Workarounds
No response
Configuration
windows up to date, vs up to date, x64
Other information
No response
- Lenguaje dominante
- C#
- Estrellas
- 18.4k
- Forks
- 5.8k
- Merge medio
- 2 d 13 h
- PR fusionados (30 d)
- 588
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotnet/runtime
-
area-System.IO untriaged
Dificultad 2/5 Medio día Aptitud para principiantes 72/100
dotnet/runtime#136802 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[wasi] .NET 10: WasmEnableSIMD with AOT fails because WasiApp.targets has -msimd128 commented outAbiertoarea-Build-mono untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area-System.ComponentModel untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
dotnet/runtime#136608 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
MemoryMappedFile (Windows): failed MEM_COMMIT is ignored, accessor over reserved memory crashes the processPosiblemente ocupada @RutulPatel8 la tomó hace 1 día. Abiertoarea-System.IO bug untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/runtime#136599 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-System.IO untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
dotnet/runtime#136577 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de dotnet/runtime
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
RadicalCSG/com.chisel#192 ·
Los mantenedores suelen responder en 1 día
-
area-testing p2-post-1.0 technical-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
RazorConsole/RazorConsole#447 ·
Los mantenedores suelen responder en 1 día
-
CloudEventsMiddleware decodes JSON string data for `+json` content typesPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
dapr/dotnet-sdk#1964 ·
Los mantenedores suelen responder en 1 día
-
bug P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día