File tree Expand file tree Collapse file tree
src/analyzers/TedToolkit.Quantities.Analyzer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33[ QuantityOperator < AbsorbedDose , AbsorbedDose , double > ( Operator . Divide ) ]
44partial struct AbsorbedDose
55{
6-
6+ public static void Test ( )
7+ {
8+ var a = new AbsorbedDose ( 10 , AbsorbedDoseUnit . Centigray ) ;
9+ var b = new AbsorbedDose ( 10 , AbsorbedDoseUnit . Centigray ) ;
10+ var c = a / b ;
11+ }
712}
Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ public void GenerateCode(SourceProductionContext context)
4545 foreach ( var attributeData in quantitySymbol . GetAttributes ( )
4646 . Where ( a => a . AttributeClass is { IsGenericType : true } attributeClass
4747 && attributeClass . ConstructUnboundGenericType ( ) . GetName ( ) . FullName is
48- "global::TedToolkit.Quantities.QuantityOperatorAttribute<,>" ) )
48+ "global::TedToolkit.Quantities.QuantityOperatorAttribute<,, >" ) )
4949 {
5050 if ( attributeData . ConstructorArguments . FirstOrDefault ( ) . Value is not byte value ) continue ;
5151
52- if ( attributeData . AttributeClass is not { TypeArguments . Length : > 1 } attributeClass ) continue ;
52+ if ( attributeData . AttributeClass is not { TypeArguments . Length : > 2 } attributeClass ) continue ;
5353
5454 var leftType = attributeClass . TypeArguments [ 0 ] . GetName ( ) ;
5555 var rightType = attributeClass . TypeArguments [ 1 ] . GetName ( ) ;
You can’t perform that action at this time.
0 commit comments