File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,17 +235,17 @@ private void FixInstructions()
235235 var nextInstruction = instruction . Next ;
236236 if ( instruction . Operand is FieldReference opFieldReference )
237237 {
238- instruction . Operand = _moduleWeaver . ModuleDefinition . ImportReference ( opFieldReference ) ;
238+ instruction . Operand = _moduleWeaver . ModuleDefinition . ImportReference ( opFieldReference , _parentMethod ) ;
239239 }
240240
241241 if ( instruction . Operand is MethodReference opMethodReference )
242242 {
243- instruction . Operand = _moduleWeaver . ModuleDefinition . ImportReference ( opMethodReference ) ;
243+ instruction . Operand = _moduleWeaver . ModuleDefinition . ImportReference ( opMethodReference , _parentMethod ) ;
244244 }
245245
246246 if ( instruction . Operand is TypeReference opTypeReference )
247247 {
248- instruction . Operand = _moduleWeaver . ModuleDefinition . ImportReference ( opTypeReference ) ;
248+ instruction . Operand = _moduleWeaver . ModuleDefinition . ImportReference ( opTypeReference , _parentMethod ) ;
249249 }
250250
251251 if ( instruction . Operand is Instruction opInstruction )
@@ -796,6 +796,12 @@ public void Process()
796796 newInstruction = Instruction . Create ( instruction . OpCode , _typeResolver . Resolve ( typeReference ) ) ;
797797 }
798798
799+ // resolve generic fields
800+ if ( _typeResolver != null && instruction . Operand is FieldReference fieldReference )
801+ {
802+ newInstruction = Instruction . Create ( instruction . OpCode , _typeResolver . Resolve ( fieldReference ) ) ;
803+ }
804+
799805 if ( newInstruction == null )
800806 {
801807 newInstruction = OpCodeHelper . Clone ( instruction ) ;
Original file line number Diff line number Diff line change 1212 <PackageOutputPath >$(SolutionDir)/../nugets</PackageOutputPath >
1313 <PackageProjectUrl >https://github.com/oleg-st/InlineMethod.Fody</PackageProjectUrl >
1414 <GeneratePackageOnBuild >false</GeneratePackageOnBuild >
15- <Version >0.7.3 </Version >
15+ <Version >0.7.4 </Version >
1616 </PropertyGroup >
1717
1818 <ItemGroup >
You can’t perform that action at this time.
0 commit comments