@@ -1499,15 +1499,19 @@ static void makeStructRawValued(
1499
1499
createValueConstructor (Impl, structDecl, var,
1500
1500
/* wantCtorParamNames=*/ false ,
1501
1501
/* wantBody=*/ !Impl.hasFinishedTypeChecking ()));
1502
- structDecl->addMember (
1502
+
1503
+ auto *initRawValue =
1503
1504
createValueConstructor (Impl, structDecl, var,
1504
1505
/* wantCtorParamNames=*/ true ,
1505
- /* wantBody=*/ !Impl.hasFinishedTypeChecking ()));
1506
+ /* wantBody=*/ !Impl.hasFinishedTypeChecking ());
1507
+ structDecl->addMember (initRawValue);
1506
1508
structDecl->addMember (patternBinding);
1507
1509
structDecl->addMember (var);
1508
1510
structDecl->addMember (varGetter);
1509
1511
1510
1512
addSynthesizedTypealias (structDecl, ctx.Id_RawValue , underlyingType);
1513
+ Impl.RawTypes [structDecl] = underlyingType;
1514
+ Impl.RawInits [structDecl] = initRawValue;
1511
1515
}
1512
1516
1513
1517
// / Create a rawValue-ed constructor that bridges to its underlying storage.
@@ -1650,6 +1654,8 @@ static void makeStructRawValuedWithBridge(
1650
1654
structDecl->addMember (computedVarGetter);
1651
1655
1652
1656
addSynthesizedTypealias (structDecl, ctx.Id_RawValue , bridgedType);
1657
+ Impl.RawTypes [structDecl] = bridgedType;
1658
+ Impl.RawInits [structDecl] = init;
1653
1659
}
1654
1660
1655
1661
// / Build a declaration for an Objective-C subscript getter.
@@ -2852,6 +2858,8 @@ namespace {
2852
2858
enumDecl->addMember (rawValueBinding);
2853
2859
2854
2860
addSynthesizedTypealias (enumDecl, C.Id_RawValue , underlyingType);
2861
+ Impl.RawTypes [enumDecl] = underlyingType;
2862
+ Impl.RawInits [enumDecl] = rawValueConstructor;
2855
2863
2856
2864
// If we have an error wrapper, finish it up now that its
2857
2865
// nested enum has been constructed.
0 commit comments