Skip to content

在async方法下使用字典TryGetValue out 一个继承主工程的类型,返回值错误的设为适配器类型 #759

@827922094

Description

@827922094

在async下使用字典TryGetValue out一个继承主工程类型的对象,返回值异常


static async void Test()
{
Dictionary<string, SingleRankingItem> keyValuePairs = new
Dictionary<string, SingleRankingItem>();
keyValuePairs.Add("95",new SingleRankingItem ());
if (keyValuePairs.TryGetValue("95", out SingleRankingItem value))
{
UnityEngine.Debug.LogError(value.GetType().FullName);
}
}

这里应该返回的是SingleRankingItem 对象,但是却返回了XXXX.Adapter

Unity Version
2021.3.15f1

ILRuntime Version
2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions