File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,14 +65,24 @@ private JSExpression ConstructInvocation (
6565 if ( ! actualMethod . Reference . Name . Contains ( correctName ) ) {
6666 var dt = originalMethod . Method . DeclaringType ;
6767
68- var actualMethodInfo = dt . Members . Values
69- . OfType < MethodInfo > ( ) . FirstOrDefault (
70- ( m ) => (
71- m . Name . Contains ( correctName ) &&
72- m . DeclaringType == originalMethod . Method . DeclaringType
73- )
68+ var candidateMethodInfos = dt . Members . Values
69+ . OfType < MethodInfo > ( ) . Where (
70+ m => m . Name . Contains ( correctName )
7471 ) ;
7572
73+ var actualMethodInfo = candidateMethodInfos . FirstOrDefault (
74+ m => m . DeclaringType == originalMethod . Method . DeclaringType
75+ ) ;
76+
77+ if ( actualMethodInfo == null )
78+ return new JSUntranslatableExpression ( String . Format (
79+ "{0} to property {1}::{2} could not be translated because {3} could not be found" ,
80+ pa . IsWrite ? "Write" : "Read" ,
81+ originalMethod . Reference . DeclaringType . FullName ,
82+ pa . Property . Property . Name ,
83+ correctName
84+ ) ) ;
85+
7686 MethodReference actualMethodReference = actualMethodInfo . Member ;
7787 if ( originalMethod . Reference is GenericInstanceMethod ) {
7888 throw new InvalidDataException ( "Reconstructing an invocation of a generic instance method? Shouldn't be possible." ) ;
You can’t perform that action at this time.
0 commit comments