Avoid unnecessary CompilableProvier castings (#84)#274
Avoid unnecessary CompilableProvier castings (#84)#274alex-kulakov merged 3 commits intoDataObjects-NET:masterfrom
Conversation
|
Hello, so this is similar to the case in #261, right? |
|
With these changes of By the way, some members of |
|
Right now returning Casting to base class is compile-time, so it is free. |
|
But it blocks overriding methods from being able to return something other than provider type of parameter. I would vote for keeping
I believe that tells that returning Also, I'm getting rid of |
|
My guess was that every Ok, I've changed return type to |
This is true but mostly for sealed classes, also might be true for some in-between classes. For instance, ColumnMappingInspector does not change structure of This is what I did in my changes to this PR, I agreed with you and made children types take advantage of covariant returns where it is possible. |
* Make CompilableProviderVisitor API declaration for provider vistitors - ProviderVisitor no longer parent type for any other type and [Obsolete] - ProviderVisitor changes reverted - CompilableProviderVisitor gets protected Visit method from ProviderVisitor and all the summaries coppied; also changes signature of expressionTranslator to not allow having Provider as incoming parameter and cause issies. * Apply covariant returns to CompilableProviderVisitor descendants * CompilableProviderVisitor: convert IFs to conditionals * Revert obsolescence of ProviderVisitor
* Use C#9 Covariant return types feature for Clone() implementation for more type safety * Make SqlNodeCloneContext readonly struct * Continue refactoring * Refactor other Clone() * Get rid of IsNullReference() in modified lines * Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * Avoid unnecessary CompilableProvier castings (#84) * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlUserFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCustomFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * make VisitNullable() private * ToArray(t.tables.Length) for consistency * SqlServer: Both US English and British English are considered english * Improve changelog * Fix build * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Update Orm/Xtensive.Orm/Sql/Internals/SqlNodeCloneContext.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Fix SqlTruncateTable.Clone() * Fix build * Refactor SqlInsert.Clone() * Changelog improved * Return CompilableProvider from Visitors * Proposes changes on top of DataObjects-NET#274 (#134) * Make CompilableProviderVisitor API declaration for provider vistitors - ProviderVisitor no longer parent type for any other type and [Obsolete] - ProviderVisitor changes reverted - CompilableProviderVisitor gets protected Visit method from ProviderVisitor and all the summaries coppied; also changes signature of expressionTranslator to not allow having Provider as incoming parameter and cause issies. * Apply covariant returns to CompilableProviderVisitor descendants * CompilableProviderVisitor: convert IFs to conditionals * Revert obsolescence of ProviderVisitor --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
* Use C#9 Covariant return types feature for Clone() implementation for more type safety * Make SqlNodeCloneContext readonly struct * Continue refactoring * Refactor other Clone() * Get rid of IsNullReference() in modified lines * Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * Avoid unnecessary CompilableProvier castings (#84) * Fix hinding exception & StackTrace in OpenSessionInternalAsync() * Flatten AggregateException with single inner exception * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlUserFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCustomFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * make VisitNullable() private * ToArray(t.tables.Length) for consistency * SqlServer: Both US English and British English are considered english * Improve changelog * Fix build * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Update Orm/Xtensive.Orm/Sql/Internals/SqlNodeCloneContext.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Fix SqlTruncateTable.Clone() * Fix build * Refactor SqlInsert.Clone() * Changelog improved * Return CompilableProvider from Visitors * Proposes changes on top of DataObjects-NET#274 (#134) * Make CompilableProviderVisitor API declaration for provider vistitors - ProviderVisitor no longer parent type for any other type and [Obsolete] - ProviderVisitor changes reverted - CompilableProviderVisitor gets protected Visit method from ProviderVisitor and all the summaries coppied; also changes signature of expressionTranslator to not allow having Provider as incoming parameter and cause issies. * Apply covariant returns to CompilableProviderVisitor descendants * CompilableProviderVisitor: convert IFs to conditionals * Revert obsolescence of ProviderVisitor * Improve changelog --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
* Use C#9 Covariant return types feature for Clone() implementation for more type safety * Make SqlNodeCloneContext readonly struct * Continue refactoring * Refactor other Clone() * Get rid of IsNullReference() in modified lines * Small optimizations (#74) * Optimize VisitMethodCall() * Optimize Provider constructor * Use Array.Empty<T>() instead of allocating Empty array * Get rid of unused PriorityQueue<> class * VisitNullable() * Avoid unnecessary CompilableProvier castings (#84) * Avoid unnecessary CompilableProvier castings (#84) * Refactor ProviderVisitor to avoid code duplication (#86) * Fix hinding exception & StackTrace in OpenSessionInternalAsync() * Flatten AggregateException with single inner exception * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlUserFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Update Orm/Xtensive.Orm/Sql/Dml/Expressions/SqlCustomFunctionCall.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * make VisitNullable() private * ToArray(t.tables.Length) for consistency * SqlServer: Both US English and British English are considered english * Improve changelog * Fix build * Change version to next developing * Add changelog file * After merge changes - TestHelper.AddValueRow() is for all build targets - SqlSessionHandler: shared code for async and sync Execute + renames - TemporaryTableManager: removed unused code - CommandFactory: removed commented code - DomainConfuguration: fixed bug of MaxNumberOfConditions value not being validated (added tests to make sure that validation happens) - Test for temp table popupation - Updated MaxQueryParameterCount for Oracle and PostgreSQL 9.0+ * Add new storage configurations + enrich supported databases list * Fixed bad merge results * Remove usage of obsolete SqlInsert.Values from object cloning * Changelog improved * Update Orm/Xtensive.Orm/Sql/Internals/SqlNodeCloneContext.cs Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net> * Fix SqlTruncateTable.Clone() * Fix build * Refactor SqlInsert.Clone() * Changelog improved * Return CompilableProvider from Visitors * Proposes changes on top of DataObjects-NET#274 (#134) * Make CompilableProviderVisitor API declaration for provider vistitors - ProviderVisitor no longer parent type for any other type and [Obsolete] - ProviderVisitor changes reverted - CompilableProviderVisitor gets protected Visit method from ProviderVisitor and all the summaries coppied; also changes signature of expressionTranslator to not allow having Provider as incoming parameter and cause issies. * Apply covariant returns to CompilableProviderVisitor descendants * CompilableProviderVisitor: convert IFs to conditionals * Revert obsolescence of ProviderVisitor * Improve changelog * After-merge fix * Prevent continuation happening if parent task was canceled otherwise OperationCanceledException will be swallowed --------- Co-authored-by: Alexey Kulakov <alexey.kulakov@dataobjects.net>
No description provided.