JavaSE12版本使用switch判断String类型时报错

在使用switch判断String类型时遇到报错,使用的JavaSE12版本,JavaSE7之后Java的switch已经支持switch判断String类型了。
代码如下:

public CashSuper getCash(String type){
    CashSuper cashSuper = null;
    switch (type){
        case "normal":
            cashSuper = new CashNomal();
            break;
        case "return":
            CashReturn cr1 = new CashReturn("300", "100");
            cashSuper = cr1;
            break;
        case "rebate":
            CashRebate cr2 = new CashRebate("0.8");
            cashSuper = cr2;
            break;
    }
    return cashSuper;
}

报错如下:

图片说明

请问这个问题在哪里,是JavaSE12存在的问题么?有遇到类似问题的么,谢谢!

可以把String类型的type修改一个枚举类类型,就可以解决