How do I test for typeof(dynamic)?

被刻印的时光 ゝ 提交于 2019-12-05 03:02:43

Simply speaking you cannot because there is no type dynamic. In type dynamic is written out as object with a special attribute attached (Dynamic) if the type appears in metadata. Essentially saying typeof(dynamic) is no different than typeof(object) for most purposes.

It is not necessary for object declared as dynamic to be some specific type of object. It can be a subclass of DynamicObject (and thus provide specific logic for operations lookup), but it can be a normal object as well (as @JaredPar said).

Maybe, if you explain what sort of branch you want to make for dynamic objects it would be possible to find better solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!