Removes unused union code path in generation environment.
@@ -24,7 +24,6 @@ import com.google.j2cl.ast.Variable;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import java.util.stream.Collectors;
/** Contains aliases for variables and Type Descriptors. */
public class GenerationEnvironment {
@@ -63,13 +62,7 @@ public class GenerationEnvironment {
public String aliasForType(TypeDescriptor typeDescriptor) {
checkArgument(!typeDescriptor.isTypeVariable());
checkArgument(!typeDescriptor.isWildCardOrCapture());
- if (typeDescriptor.isUnion()) {
- return typeDescriptor
- .getUnionedTypeDescriptors()
- .stream()
- .map(this::aliasForType)
- .collect(Collectors.joining(" | ", "(", ")"));
- }
+ checkArgument(!typeDescriptor.isUnion());
return aliasForType(typeDescriptor.getTypeDeclaration());
}
