Asteroid.Validation.CompilerTools
0.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Asteroid.Validation.CompilerTools --version 0.1.0
NuGet\Install-Package Asteroid.Validation.CompilerTools -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Asteroid.Validation.CompilerTools" Version="0.1.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asteroid.Validation.CompilerTools" Version="0.1.0" />
<PackageReference Include="Asteroid.Validation.CompilerTools"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Asteroid.Validation.CompilerTools --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Asteroid.Validation.CompilerTools, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Asteroid.Validation.CompilerTools@0.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Asteroid.Validation.CompilerTools&version=0.1.0
#tool nuget:?package=Asteroid.Validation.CompilerTools&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Asteroid.Validation.CompilerTools
Asteroid.Validation 的配套源生成器(注册闭包模型的一次到位后端)。
机制
对编译内每个基链可达 [Validatable] 族 att 的类/结构(自带声明,或任一基类声明——att 派生形如
[OsSchema] 同认)发射 partial 片:
protected/internal static readonly ValidationEntry[] ValidationEntriesCore——声明面条目累积 (先基后派生;跨程序集基类经其自身生成片的 protected 累积数组续链);ValidationValidatorsCore——[TypeValidator] 直接委托(先基后派生;反射 Invoke 与 TIE 解包退役);IValidatable.Plan——ValidationPlanBuilder.Compose(条目, 委托, 面, typeof(T))静态构建一次 (合成语义单源在框架运行时——面应用/重声明覆盖/例外位均在 Compose)。
条目内容:成员名(路径段原样)、类型化取值器包装方法、规则 att 字面量(构造实参烘焙为常量,
语义单源在 att 类;[ValidateBy] 解析为生成出口的委托形态)、可见性/种类/[VldMember]/[VldIgnore] 位。
诊断(VALD 段;与 MetaAtt 互补不重叠——词汇可表达的约束住 MetaAtt,本生成器只查残余面)
| 码 | 语义 |
|---|---|
| VALD0001 | [ValidateBy] 目标方法签名不符(存在性/void/static 归 MetaAtt;此处查参数个数/首参/ctx 位) |
| VALD0002 | [TypeValidator] 首参非声明类型兼容形(static/void/两参/ctx 位归 MetaAtt) |
| VALD0003 | 成员取值器无法发射(ref 结构/指针/函数指针成员带 gated att 或入面)——反射时代为静默滤除,升格显式红 |
| VALD0004 | file 作用域闭包类(file-local 类型跨文件不合并 partial,无法补片) |
| VALD0005 | 作者成员占用生成物保留标识符(ValidationEntriesCore/ValidationValidatorsCore/s_validationPlan) |
约束
- 闭包类必须 partial([Validatable] 上的 MetaAtt
[ModifierConstraint(Partial)]把关——非 partial=AST0040); file作用域类禁入闭包(VALD0004);- att 构造实参须为编译期常量(C# att 语法天然保证)。
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.