Skip to content

Commit 5415d6d

Browse files
committed
[Compile Time Values] Add a FIXME comment about var/let on protocol requirements
1 parent f402eb6 commit 5415d6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,8 @@ void AttributeChecker::visitMoveOnlyAttr(MoveOnlyAttr *attr) {
28472847
void AttributeChecker::visitConstValAttr(ConstValAttr *attr) {
28482848
auto *VD = dyn_cast<VarDecl>(D);
28492849
if (VD) {
2850+
// FIXME: Do not allow 'var' on @const protocol requirements, only allow
2851+
// 'let' (once that's implemented to be allowed at all).
28502852
if (!VD->isLet() && !isa<ProtocolDecl>(D->getDeclContext())) {
28512853
diagnose(D->getStartLoc(), diag::attr_only_one_decl_kind,
28522854
attr, "let");

0 commit comments

Comments
 (0)