[英]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.