@@ -644,6 +644,69 @@ static class C {
644644 Assert . Equal ( "EFP0002" , diagnostic . Id ) ;
645645 }
646646
647+ [ Fact ]
648+ public void NullableMemberBinding_UndefinedSupport_IsBeingReported ( )
649+ {
650+ var compilation = CreateCompilation ( @"
651+ using System;
652+ using System.Linq;
653+ using EntityFrameworkCore.Projectables;
654+
655+ namespace Foo {
656+ static class C {
657+ [Projectable]
658+ public static int? GetLength(this string input) => input?.Length;
659+ }
660+ }
661+ " ) ;
662+ var result = RunGenerator ( compilation ) ;
663+
664+ var diagnostic = Assert . Single ( result . Diagnostics ) ;
665+ Assert . Equal ( "EFP0002" , diagnostic . Id ) ;
666+ }
667+
668+
669+ [ Fact ]
670+ public void MultiLevelNullableMemberBinding_UndefinedSupport_IsBeingReported ( )
671+ {
672+ var compilation = CreateCompilation ( @"
673+ using System;
674+ using System.Linq;
675+ using EntityFrameworkCore.Projectables;
676+
677+ namespace Foo {
678+ public record Address
679+ {
680+ public int Id { get; set; }
681+ public string? Country { get; set; }
682+ }
683+
684+ public record Party
685+ {
686+ public int Id { get; set; }
687+
688+ public Address? Address { get; set; }
689+ }
690+
691+ public record Entity
692+ {
693+ public int Id { get; set; }
694+
695+ public Party? Left { get; set; }
696+ public Party? Right { get; set; }
697+
698+ [Projectable]
699+ public bool IsSameCountry => Left?.Address?.Country == Right?.Address?.Country;
700+ }
701+ }
702+ " ) ;
703+ var result = RunGenerator ( compilation ) ;
704+
705+ Assert . All ( result . Diagnostics , diagnostic => {
706+ Assert . Equal ( "EFP0002" , diagnostic . Id ) ;
707+ } ) ;
708+ }
709+
647710 [ Fact ]
648711 public Task NullableMemberBinding_WithIgnoreSupport_IsBeingRewritten ( )
649712 {
0 commit comments