From: Michal Strehovský Date: Tue, 16 May 2023 17:40:18 +0000 (+0900) Subject: Implement GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution... X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~2192 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fca5414c9766137bf226ff5418e7a1e1ef80e4ca;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Implement GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution (#86310) This was reached in the Pri0 test suite. --- diff --git a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs index 5f2d9b5..480c4f4 100644 --- a/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs +++ b/src/coreclr/tools/Common/TypeSystem/RuntimeDetermined/FunctionPointerType.RuntimeDetermined.cs @@ -24,8 +24,12 @@ namespace Internal.TypeSystem public override TypeDesc GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution(Instantiation typeInstantiation, Instantiation methodInstantiation) { - Debug.Assert(false); - return this; + var sigBuilder = new MethodSignatureBuilder(_signature); + sigBuilder.ReturnType = _signature.ReturnType.GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution(typeInstantiation, methodInstantiation); + for (int i = 0; i < _signature.Length; i++) + sigBuilder[i] = _signature[i].GetNonRuntimeDeterminedTypeFromRuntimeDeterminedSubtypeViaSubstitution(typeInstantiation, methodInstantiation); + MethodSignature newSig = sigBuilder.ToSignature(); + return newSig == _signature ? this : Context.GetFunctionPointerType(newSig); } } }