Skip to content

Conversation

deepsource-autofix[bot]
Copy link
Contributor

No description provided.

SubclassMapping subclassMapping;
var tempSubClassMap = mapping as SubclassMapping;
if(!tempIsNull && tempMapping.IsUnionSubclass || tempSubClassMap != null && tempSubClassMap.SubclassType == SubclassType.UnionSubclass)
if(!tempIsNull && tempMapping.IsUnionSubclass || mapping is SubclassMapping tempSubClassMap&& tempSubClassMap.SubclassType == SubclassType.UnionSubclass)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pawan-deepsource this is failing with:

C:\projects\fluent-nhibernate\src\FluentNHibernate\Automapping\AutoMapper.cs(86,45): error CS0165: Use of unassigned local variable 'tempSubClassMap' [C:\projects\fluent-nhibernate\src\FluentNHibernate\FluentNHibernate.csproj]
C:\projects\fluent-nhibernate\src\FluentNHibernate\Automapping\AutoMapper.cs(86,45): error CS0165: Use of unassigned local variable 'tempSubClassMap' [C:\projects\fluent-nhibernate\src\FluentNHibernate\FluentNHibernate.csproj]
C:\projects\fluent-nhibernate\src\FluentNHibernate\Automapping\AutoMapper.cs(86,45): error CS0165: Use of unassigned local variable 'tempSubClassMap' [C:\projects\fluent-nhibernate\src\FluentNHibernate\FluentNHibernate.csproj]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(in a next condition)

Copy link

@pawan-deepsource pawan-deepsource Oct 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is actually a false positive since there's a reference to tempSubClassMap after the cast on L86. Autofix wouldn't have failed if the check hadn't fired in the first place. IMO, it was the check that misled Autofix and that's where the problem is. Tracking it internally.

Edit: Will also ensure that the whitespace and formatting is preserved.

@hazzik hazzik enabled auto-merge (squash) October 24, 2022 22:11
@hazzik hazzik merged commit d5c906e into master Oct 24, 2022
@hazzik hazzik deleted the deepsource-fix-89bd0c58 branch October 24, 2022 22:16
@hazzik hazzik added this to the vNext milestone Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants