C# printer: nine unit-test samples that Roslyn rejects

Abierto
#185 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
61/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, java
Área
devtools, testing

Línea de trabajo

Read the listed TestJavaToCSharpStructure and TestJavaToCSharpBcl samples, then run the C# printer unit tests with CSharpCheck via tools/csharp-check -serve. Fix each remaining printer bug identified by the Roslyn errors and remove its compile = false marker; the issue is done when all samples compile. The inherited-family test fault is already fixed.

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

Descripción

bug

The C# printer's unit tests now have Roslyn judge every sample (CommonJavaToCSharp.translate, CSharpCheck on tools/csharp-check -serve). On the first run, 9 of 131 samples do not compile. Each test sets compile = false with a pointer here until its printer bug is fixed; this issue closes when none is left.

  • TestJavaToCSharpStructure.conditionalVars: var node = c ? new IndexedExists<A, B>() : new UnindexedExists<A, string>() — CS0173, C# finds no common type for a conditional of two sibling classes; Java's is the common supertype (declare it, or cast one branch).
  • TestJavaToCSharpStructure.innerClasses: Upcoming : IJavaIterator<long> with long? Next() — CS0738, the boxed Long next() must override as long, as it does for a top-level class.
  • TestJavaToCSharpStructure.localClasses: a local class that captures (Adder) is referenced but not printed anywhere — CS0246.
  • TestJavaToCSharpStructure.longTypeArguments: a cast through a wildcard printed as object — CS0030 (the wildcard family).
  • TestJavaToCSharpStructure.suppliers: sealed class Defaults<R> where R : Defaults<R> — CS0701, a class that is a type parameter's bound cannot be sealed.
  • TestJavaToCSharpStructure.tryWithResources: System.gc() unmapped (GC.Collect()).
  • TestJavaToCSharpStructure.wildcardInterfaces: the wildcard interface IImpacter and the companion static class IImpacter of IImpacter<G> clash — CS0102.
  • TestJavaToCSharpBcl.navigation: three errors in one sample: T[] ToArray<T>(T[] a) => items.ToArray() (CS0029, E[] to T[]), !Contains(v) && items.Add(v) where Add is void on a HashSet-backed ICollection (CS0019), and c.All(...) on the non-generic ICollection (CS1061).
  • TestJavaToCSharpFacts.inheritedFamilyAndStructs was the test's own fault (a package-private method implementing an interface method is not Java either) and is fixed.
Lenguaje dominante
Java
Estrellas
1
Forks
1
Merge medio
1 h 13 min
PR fusionados (30 d)
6

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CodeLaser/maddi

Todos los issues de CodeLaser/maddi

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.