microsoft / microsoft/TypeScript
random error TS2345 type incompatible
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms:
Code
this._globPartsArray.forEach((g: IPartsPattern, idx) =>
{
// Use matches[idx + 1] because whole match is at index 0 of the array of matches
if (g === EnumWildcard.Asterisk || g === EnumWildcard.QuestionMark)
{
this._groups.push(Object.freeze({
type: EnumPartsAstType.wildcard,
pattern: g,
match: matches[idx + 1],
}));
}
else
{
this._groups.push(Object.freeze({
type: EnumPartsAstType.literal,
pattern: g,
match: matches[idx + 1],
}));
}
});
Expected behavior:
no error by random happen
Actual behavior:
bandicam 2020-07-23 09-49-14-211.zip
Error:(143, 23) TS2345: Argument of type 'Readonly<{ type: EnumPartsAstType; pattern: string; match: string; }>' is not assignable to parameter of type 'Error | IAsterisk | IQuestionMark | ILiteral'.
Type 'Readonly<{ type: EnumPartsAstType; pattern: string; match: string; }>' is not assignable to type 'ILiteral'.
Types of property 'type' are incompatible.
Type 'EnumPartsAstType' is not assignable to type 'EnumPartsAstType.literal'.
Playground Link:
Related Issues:
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.
Línea de trabajo
Comience reproduciendo el error de packages/@lazy-glob/rename/lib/util/globGroupsCollection.ts en las líneas 130-149 con la versión de TypeScript 3.7.x-dev indicada y con una versión actual. Inspeccione el tipo inferido del objeto pasado a _groups.push y determine si el diagnóstico es reproducible; la tarea requiere una reproducción mínima o un defecto confirmado del compilador con una prueba adecuada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- compilers
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 18/100