简体   繁体   English

单声道抛出我认为不正确的警告

[英]Mono throwing warning that I don't think is correct

Mono is throwing the warning: Mono发出警告:

warning CS0414: The private field 'Convergence.Core.Services.PermissionService.userService' is assigned but its value is never used

Which is strange, since it is most certainly used: 这很奇怪,因为最肯定会使用它:

For instance: 例如:

var systemRoles = (
    from e 
    in systemRoleRepository.Entities 
    where e.User.Username.Equals(userService.CurrentUser.Username)
    select e
).ToList();

(The where clause makes use of userService). (where子句使用userService)。

The object is the same object that the compiler is comlaining about, and is declared as: 该对象与编译器正在声明的对象相同,并声明为:

private readonly IUserService userService;

To determine that it is in fact being used, if I comment out the declaration, the Mono compiler throws and error on that LINQ query saying userService isn't declared. 为了确定它实际上正在被使用,如果我注释掉该声明,Mono编译器将对该LINQ查询抛出错误并说未声明userService。

Am I missing something really really obvious, or is this a bug in the mono compiler (dmcs on 2.8.1 on RHEL 5.5 by the way). 我是否遗漏了一些确实很明显的东西,或者这是单声道编译器中的错误(顺便说一句,RHEL 5.5在2.8.1上的dmcs)。

This is almost certainly a bug. 这几乎可以肯定是一个错误。 Please file it at Novell's bug tracker . 请提交到Novell的错误跟踪器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我不认为我要修改此收藏集 - I don't think I'm modifying this collection Azure中的WCF声称我的证书不匹配,但我认为我不知道 - WCF in Azure claims I have a cert mismatch but I don't think I do 我在我的WebPages网站上实现了缓存,但我认为它不起作用 - I implemented caching in my WebPages site, but I don't think it's working 我认为我的using指令会创建我不想拥有的.dll - I think my using directive creates .dll i don't want to have 如何取消任务 - 尝试使用 CancellationTokenSource,但我想我不明白这个概念 - How to cancel a task - trying to use a CancellationTokenSource, but I think I don't get the concept 此代码段中是否存在无法访问的代码? 我不这么认为,但是Resharper却告诉我了 - Is there unreachable code in this snippet? I don't think so, but Resharper is telling me otherwise Array.sort函数影响我认为不应该影响的数组 - Array.sort function affecting arrays that I don't think it should affect 在 c# 中使用 table.Rows.count 我认为我的数据库没有连接 - Using table.Rows.count in c# i don't think my database is connected C# “这里的字符串可能是 null” 但我不认为它可能是 null - C# “String may be null here” but I don't think it can be null 为什么这个 C# 代码乱序执行? 不是 ASYNC(至少我认为不是) - Why is this C# code executing out of sequence? Not ASYNC (at least I don't think it is)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM