Skip to content

Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.QualifiedNameSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax' #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
symbarh opened this issue Mar 2, 2024 · 1 comment · Fixed by #101
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@symbarh
Copy link

symbarh commented Mar 2, 2024

EntityFrameworkCore.Projectables.Generator.ProjectionExpressionGenerator is not generating ay files causing this error
Generator 'ProjectionExpressionGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.QualifiedNameSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax'

@symbarh symbarh changed the title ProjectionExpressionGenerator is not generating any files Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.QualifiedNameSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax' Mar 2, 2024
@symbarh
Copy link
Author

symbarh commented Mar 2, 2024

narrowed the problem to this property

 [NotMapped]
 [Projectable]
 public PostType? PostType => Local.PostType.Ar | Local.PostType.GlCr | Local.PostType.GlDr;

where PostType is defined as

[Flags]
public enum PostType : byte
{
    Ar = 0b1,
    GlCr = 0b10,
    GlDr = 0b100
}

@koenbeuk koenbeuk added bug Something isn't working help wanted Extra attention is needed labels Mar 5, 2024
PhenX added a commit to PhenX/EntityFrameworkCore.Projectables that referenced this issue Mar 5, 2024
koenbeuk added a commit that referenced this issue Mar 8, 2024
Fix QualifiedNameSyntax visiting (fixes #100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants