首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >C#应用程序中由于评论中的引用而产生的模糊引用错误?

C#应用程序中由于评论中的引用而产生的模糊引用错误?
EN

Stack Overflow用户
提问于 2015-11-02 04:11:02
回答 2查看 1.7K关注 0票数 8

这是我从未见过的新问题。它发生在LibCURL.NET的开源包装器中:

http://sourceforge.net/projects/libcurl-net/

我得到了一个模糊的引用“警告为错误”,但奇怪的是,这是由于一个LibCURL源文件中的CREF引用(见下文)。对于名为Easy.GetInfo()的方法,确实有几个不同的重载,但我不知道如何解决这个问题,因为违规代码不是对Easy.GetInfo()的方法调用,实际上它根本不是代码,而是Enum注释中的CREF元素。有人知道怎么解决这个问题吗?

代码语言:javascript
复制
/// <summary>
/// This enumeration is used to extract information associated with an
/// <see cref="Easy"/> transfer. Specifically, a member of this
/// enumeration is passed as the first argument to
/// <see cref="Easy.GetInfo"/> specifying the item to retrieve in the
/// second argument, which is a reference to an <c>int</c>, a
/// <c>double</c>, a <c>string</c>, a <c>DateTime</c> or an <c>object</c>.
/// </summary>
public enum CURLINFO
{
    ...

注意:我为LibCURL.NET框架版本4.5.1重新设定了目标。我提到这一点是为了防止与此事有关。

EN

回答 2

Stack Overflow用户

发布于 2015-11-02 05:01:19

我在推特上得到了答复,谢谢彼得·弗特。这真的是一个模糊的解决方案,所以我把它放在这里,让其他人找到一个社区Wiki的答案。我所要做的就是在CREF目标前面加上"o:“,这告诉编译器接受对重载函数的引用。见下文:

代码语言:javascript
复制
    /// <summary>
    /// Pass a <c>bool</c>. If it is <c>true</c>, libcurl will attempt to get
    /// the modification date of the remote document in this operation. This
    /// requires that the remote server sends the time or replies to a time
    /// querying command. The <see cref="o:Easy.GetInfo"/> function with the
    /// <see cref="CURLINFO.CURLINFO_FILETIME"/> argument can be used after a
    /// transfer to extract the received time (if any).
    /// </summary>
票数 9
EN

Stack Overflow用户

发布于 2018-09-18 10:04:39

还可以回答历史:您可以通过指定其参数来引用特定的重载函数。

例如,假设您的Easy.GetInfo有一个以int作为参数的重载。您可以使用<see cref="Easy.GetInfo(int)"/>引用该特定函数。可以说,o:的东西似乎“打破了引用”。(我没有详细说明这件事。)

此外,在参数类型涉及泛型的情况下,您必须转义<>字符。在我的例子中,function(IList<uint>)必须写成function(IList&lt;uint&gt;)

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33470633

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档