Skip to content

Commit d022c4a

Browse files
committed
Sema: don't change the init kind of a ConstructorDecl when type checking its body.
1 parent 58394ed commit d022c4a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,6 @@ static void checkClassConstructorBody(ClassDecl *classDecl,
20682068
ctor->getDeclContext()->getDeclaredInterfaceType())
20692069
.fixItInsert(ctor->getLoc(), "convenience ");
20702070
ctx.Diags.diagnose(initExpr->getLoc(), diag::delegation_here);
2071-
ctor->setInitKind(CtorInitializerKind::Convenience);
20722071
}
20732072

20742073
// An inlinable constructor in a class must always be delegating,

test/SourceKit/CursorInfo/cursor_info.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ enum E7: String {
303303
// CHECK8-NEXT: (CC.Type) -> (Int) -> CC
304304
// CHECK8-NEXT: $s1x11cursor_info2CCCSi_tcD
305305
// CHECK8-NEXT: <Container>$s11cursor_info2CCCD</Container>
306-
// CHECK8-NEXT: <Declaration>convenience init(x: <Type usr="s:Si">Int</Type>)</Declaration>
307-
// CHECK8-NEXT: <decl.function.constructor><syntaxtype.keyword>convenience</syntaxtype.keyword> <syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>x</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr="s:Si">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>
306+
// CHECK8-NEXT: <Declaration>init(x: <Type usr="s:Si">Int</Type>)</Declaration>
307+
// CHECK8-NEXT: <decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>x</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr="s:Si">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>
308308

309309
// RUN: %sourcekitd-test -req=cursor -pos=23:6 %s -- -F %S/../Inputs/libIDE-mock-sdk -I %t.tmp %mcp_opt %s | %FileCheck -check-prefix=CHECK9 %s
310310
// CHECK9: source.lang.swift.decl.var.global (23:5-23:15)

0 commit comments

Comments
 (0)