Skip to content

Commit

Permalink
Merge pull request #10349 from som-snytt/issue/10639-cyclic-enum
Browse files Browse the repository at this point in the history
  • Loading branch information
SethTisue committed Mar 20, 2023
2 parents 6bc0b69 + c1f6a40 commit 8269bdd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/files/pos/t10639/Identifiable_1.java
@@ -0,0 +1,14 @@

import java.util.Map;
import java.util.function.Function;
import java.util.stream.Stream;

import static java.util.stream.Collectors.toMap;

public interface Identifiable_1 {
String name();

static <E extends Enum<E> & Identifiable_1> Map<String, E> valuesByName(final E[] values) {
return Stream.of(values).collect(toMap(Identifiable_1::name, Function.identity()));
}
}
3 changes: 3 additions & 0 deletions test/files/pos/t10639/Size_1.java
@@ -0,0 +1,3 @@
public enum Size_1 implements Identifiable_1 {
SMALL, MEDIUM, LARGE;
}
4 changes: 4 additions & 0 deletions test/files/pos/t10639/broken_2.scala
@@ -0,0 +1,4 @@

object Broken extends App {
println(Size_1.SMALL)
}

0 comments on commit 8269bdd

Please sign in to comment.