Abstract methods block coverage and direct calls when no subclass exists
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- compilers
Línea de trabajo
Start by reading the compiler paths that handle abstract method declarations, untyped property lookup, and direct calls; the issue gives reproductions but names no source files or tests. Compare the two examples with Node and inspect the existing SC1090 handling. Done means coverage treats abstract declarations as having no runtime value and direct calls match Node’s receiver, argument, and TypeError behavior. A linked pull request is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Abstract methods block coverage and direct calls when no subclass exists
The compiler refuses or defers abstract methods in two shapes that JavaScript handles.
Untyped lookup
A value held as any whose instances reach o[k] gets a branch per class and member. For an abstract method, the branch asks for the method's value, which an abstract declaration does not have. Every such branch is deferred with SC1090 values of abstract method declarations. The program runs and matches Node, but coverage never reports it as fully static.
abstract class Holder {
abstract current(): string;
}
class Impl extends Holder {
current(): string {
return "ok";
}
}
const read = (o: any, k: string) => o[k];
const impl: Holder = new Impl();
console.log(read(impl, "current"), impl.current());
On 0.4.8, scriptc coverage of the larger form in our corpus (abstract-methods-untyped-lookup.ts) reports 6 deferred sites. The same failure reproduces on main (979a65246).
Direct call
A concrete method that calls an abstract method with no concrete implementation below the receiver's static class is refused at build time, even when the program never subclasses the class. tsc makes every instantiable subclass implement the method, so no instance can reach the call.
abstract class Source {
abstract count(): number;
liveFrom(): number {
return this.count();
}
}
class Shelf {
source: Source | null = null;
}
const shelf = new Shelf();
console.log(shelf.source === null ? "none" : shelf.source.liveFrom());
Node prints none. On 0.4.8, the build fails with SC1090 calls of the abstract method 'count' with no concrete implementation below the receiver's static class.
An abstract declaration has no value at run time. An untyped lookup should select the implementation of the constructible subclass the instance belongs to, nearest first, and read undefined when no class below the receiver implements it. A direct call should evaluate its receiver and arguments, then throw Node's TypeError, <callee> is not a function.
I opened #TBD with a patch that implements both behaviors.
- Lenguaje dominante
- TypeScript
- Estrellas
- 6.5k
- Forks
- 212
- Merge medio
- 13 h 2 min
- PR fusionados (30 d)
- 798
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 vercel-labs/scriptc
-
Discarded negation of a void call rejects valid JavaScriptPosiblemente ocupada @MathurAditya724 la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 1/100
vercel-labs/scriptc#3358 ·
Los mantenedores suelen responder en 1 día
-
Optional JSDoc rejects mandatory JavaScript setter parametersPosiblemente ocupada @MathurAditya724 la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
vercel-labs/scriptc#3355 ·
Los mantenedores suelen responder en 1 día
-
Correct JavaScript refusal descriptions for mutable bindings and missing propertiesPosiblemente ocupada @MathurAditya724 la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
vercel-labs/scriptc#3354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
vercel-labs/scriptc#3330 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
vercel-labs/scriptc#3210 ·
Los mantenedores suelen responder en 1 día
Todos los issues de vercel-labs/scriptc
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/vscode-containers#655 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dsh-tauri-desk/deepseek-harness-desktop#1477 · 1 comentario ·
-
[docs] RELEASE.md: wrong branch name, no check that the prepare PR merged with the right subject, manual publish stepPosiblemente ocupada @albertteoh la tomó hoy. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
jaegertracing/jaeger-ui#4739 ·
Los mantenedores suelen responder en 1 día
-
Add: Shop On TV SDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día