修改 Project Structure > Project Setting > Modules > {your module} > Language level
Project Structure > Project Setting > Modules > {your module} > Language level
修改后就没有错误提示了