- Roslyn Cookbook
- Manish Vasani
- 111字
- 2021-07-15 17:07:30
Creating a symbol analyzer to report issues about symbol declarations
A symbol analyzer registers action callbacks to analyze one or more kinds of symbol declarations, such as types, methods, fields, properties, events, and so on, reports semantic issues about declarations.
In this section, we will create a symbol analyzer that extends the compiler diagnostic CS0542 (member names cannot be the same as their enclosing type) to report a diagnostic if member names are the same as any of the outer parent type. For example, the analyzer will report a diagnostic for the innermost type NestedClass here:
public class NestedClass
{
public class InnerClass
{
public class NestedClass
{
}
}
}
推薦閱讀
- .NET之美:.NET關(guān)鍵技術(shù)深入解析
- Java Web開發(fā)之道
- FreeSWITCH 1.6 Cookbook
- Java設(shè)計(jì)模式及實(shí)踐
- Mastering macOS Programming
- 自制編程語言
- C/C++程序員面試指南
- Learning Hadoop 2
- 軟件測試綜合技術(shù)
- Hands-On Robotics Programming with C++
- 微前端設(shè)計(jì)與實(shí)現(xiàn)
- Mastering SciPy
- RESTful Web API Design with Node.js(Second Edition)
- C語言程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)
- JavaScript Mobile Application Development