Joining on inherited natural id gives error

If I have the following entities:

@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
  name = "type",
  discriminatorType = DiscriminatorType.STRING
public abstract class TimeCode {
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    private Long id;

    @Column(name = "code", unique = true, nullable = false)
    private String code;

public class TaskCode extends TimeCode { }

public static class Post {
    private Long id;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "task", referencedColumnName = "code")
    public TaskCode task;

I get the following error:

referencedColumnNames(code) of Post.task referencing TaskCode not mapped to a single property

Why? Is this a Hibernate bug? How can I correctly create a join using the code natural id of TimeCode?

You can see the full test case here: