@@ -4082,8 +4082,9 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
4082
4082
return true ;
4083
4083
4084
4084
EnumElementDecl *Elt = cast<EnumElementDecl>(EltRef.getDecl ());
4085
- auto ResultTy = Operand->getType ().getEnumElementType (Elt, SILMod);
4086
-
4085
+ auto ResultTy = Operand->getType ().getEnumElementType (
4086
+ Elt, SILMod, B.getTypeExpansionContext ());
4087
+
4087
4088
switch (Opcode) {
4088
4089
case swift::SILInstructionKind::InitEnumDataAddrInst:
4089
4090
ResultVal = B.createInitEnumDataAddr (InstLoc, Operand, Elt, ResultTy);
@@ -4431,7 +4432,8 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
4431
4432
4432
4433
// FIXME: substitution means this type should be explicit to improve
4433
4434
// performance.
4434
- auto ResultTy = Val->getType ().getFieldType (Field, SILMod);
4435
+ auto ResultTy =
4436
+ Val->getType ().getFieldType (Field, SILMod, B.getTypeExpansionContext ());
4435
4437
if (Opcode == SILInstructionKind::StructElementAddrInst)
4436
4438
ResultVal = B.createStructElementAddr (InstLoc, Val, Field,
4437
4439
ResultTy.getAddressType ());
@@ -4453,7 +4455,8 @@ bool SILParser::parseSILInstruction(SILBuilder &B) {
4453
4455
return true ;
4454
4456
}
4455
4457
VarDecl *Field = cast<VarDecl>(FieldV);
4456
- auto ResultTy = Val->getType ().getFieldType (Field, SILMod);
4458
+ auto ResultTy =
4459
+ Val->getType ().getFieldType (Field, SILMod, B.getTypeExpansionContext ());
4457
4460
ResultVal = B.createRefElementAddr (InstLoc, Val, Field, ResultTy);
4458
4461
break ;
4459
4462
}
@@ -5136,8 +5139,8 @@ bool SILParser::parseCallInstruction(SILLocation InstLoc,
5136
5139
CanSILFunctionType substFTI = FTI;
5137
5140
if (!subs.empty ()) {
5138
5141
auto silFnTy = FnTy.castTo <SILFunctionType>();
5139
- substFTI
5140
- = silFnTy->substGenericArgs (SILMod, subs);
5142
+ substFTI =
5143
+ silFnTy->substGenericArgs (SILMod, subs, B. getTypeExpansionContext () );
5141
5144
FnTy = SILType::getPrimitiveObjectType (substFTI);
5142
5145
}
5143
5146
SILFunctionConventions substConv (substFTI, B.getModule ());
0 commit comments