palantir / palantir/conjure-java

Generate no-arg static constructor for union type of empty value

Open
#895 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
39
Forks
49
Avg merge
8h 22m
Merged PRs (30d)
32

Description

What happened?

Given the definition:

NoneType:
  fields: {}
SomeType:
  fields:
    val: any
MyUnion:
  union:
    none: NoneType
    some: SomeType

I want to be able to write MyUnion.none() instead of MyUnion.none(NoneType.of())

I've found it common to have "empty types" as part of a union

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no file, test, or entry point. Start by locating the Java generation logic for union static constructors and its tests; done means an empty-value union member can be called as MyUnion.none() while existing constructor behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.