File tree 4 files changed +13
-13
lines changed
src/Generator/Generators/CSharp 4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,8 @@ public string VisitParameter(Parameter parameter)
31
31
return $ "({ desugared . Visit ( typePrinter ) } ) { expression } ";
32
32
var finalType = ( desugared . GetFinalPointee ( ) ?? desugared ) . Desugar ( ) ;
33
33
if ( finalType . TryGetClass ( out var @class ) && @class . IsInterface )
34
- {
35
- string cast ;
36
- if ( parameter . DefaultArgument . Declaration is Method method &&
37
- method . IsConstructor && method . Namespace == @class . OriginalClass )
38
- {
39
- cast = string . Empty ;
40
- }
41
- else
42
- {
43
- cast = $ "({ @class . OriginalClass . Visit ( typePrinter ) } ) ";
44
- }
45
- return cast + expression ;
46
- }
34
+ return $@ "({ @class . Visit ( typePrinter ) } ) ({
35
+ @class . OriginalClass . Visit ( typePrinter ) } ) { expression } " ;
47
36
return expression ;
48
37
}
49
38
Original file line number Diff line number Diff line change @@ -342,6 +342,7 @@ public void TestDefaultArguments()
342
342
methodsWithDefaultValues. DefaultWithFreeConstantInNameSpace ( ) ;
343
343
methodsWithDefaultValues. DefaultWithStdNumericLimits ( 10 , 5 ) ;
344
344
methodsWithDefaultValues. DefaultWithSpecialization ( ) ;
345
+ methodsWithDefaultValues. DefaultOverloadedImplicitCtor ( ) ;
345
346
methodsWithDefaultValues. DefaultWithParamNamedSameAsMethod ( 5 ) ;
346
347
}
347
348
}
Original file line number Diff line number Diff line change @@ -822,6 +822,14 @@ void MethodsWithDefaultValues::defaultWithSpecialization(IndependentFields<int>
822
822
{
823
823
}
824
824
825
+ void MethodsWithDefaultValues::defaultOverloadedImplicitCtor (P p)
826
+ {
827
+ }
828
+
829
+ void MethodsWithDefaultValues::defaultOverloadedImplicitCtor (Qux q)
830
+ {
831
+ }
832
+
825
833
int MethodsWithDefaultValues::DefaultWithParamNamedSameAsMethod (int DefaultWithParamNamedSameAsMethod, const Foo& defaultArg)
826
834
{
827
835
return 1 ;
Original file line number Diff line number Diff line change @@ -483,6 +483,8 @@ class DLL_API MethodsWithDefaultValues : public Quux
483
483
void defaultWithStdNumericLimits (double d = 1.0 , int i = std::numeric_limits<double >::infinity());
484
484
void defaultWithParamRequiringRename (_ClassWithLeadingUnderscore* ptr = nullptr );
485
485
void defaultWithSpecialization (IndependentFields<int > specialization = IndependentFields<int >());
486
+ void defaultOverloadedImplicitCtor (P p);
487
+ void defaultOverloadedImplicitCtor (Qux q = Qux());
486
488
int DefaultWithParamNamedSameAsMethod (int DefaultWithParamNamedSameAsMethod, const Foo& defaultArg = Foo());
487
489
int getA ();
488
490
private:
You can’t perform that action at this time.
0 commit comments