Project
ReSharper
Priority
Critical
Type
Bug
Fix versions
Mirabile Futurum
State
Open
Assignee
Olga Lobacheva
Subsystem
PSI
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Olga Lobacheva
    2 years ago (02 Nov 2009 22:12)
  • Updated by   Olga Lobacheva
    7 months ago (29 Jun 2011 19:41)
  • Jira: RSRP-128643
    (history, comments)
 
RSRP-128643 Extension methods resolve in VB
1
Issue is visible to: All Users
  The issue is visible to the selected user group only
Imports System.Runtime.CompilerServices
Imports [Default].Tru.P

Namespace Tru.P 
  Public Module Ext1    
    <Extension()> _
    Public Function Foo(ByVal x As P.Bar, ByVal y As Integer) As Integer
      System.Console.WriteLine ("Ext1.Foo")
    End Function
  End Module
End Namespace 

Namespace Tru.P.P
  Public Module Ext     
    <Extension()> _
    Public Function Foo(ByVal x As Bar, ByVal y As Integer) As Integer
      System.Console.WriteLine ("Ext.Foo")
    End Function
  End Module

  Public Class Bar
    Public Sub F
      Foo(2)  'Should resolve to Ext1.Foo
    End Sub

    Public Shared Sub Main
      Dim x As New Bar
      x.F
    End Sub
  End Class
End NameSpace
Comments (3)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Olga Lobacheva
  Olga Lobacheva
02 Nov 2009 22:13
2 years ago
Imports System.Runtime.CompilerServices
Imports [Default].Tru.P

Namespace Tru.P 
  Public Module Ext1    
    <Extension()> _
    Public Function Foo(ByVal x As P.Bar, ByVal y As Object) As Integer
      System.Console.WriteLine ("Ext1.Foo")
    End Function
  End Module
End Namespace 

Namespace Tru.P.P
  Public Module Ext     
    <Extension()> _
    Public Function Foo(ByVal x As Bar, ByVal y As Integer) As Integer
      System.Console.WriteLine ("Ext.Foo")
    End Function
  End Module

  Public Class Bar
    Public Sub F
      Foo(2) ' resolve to Ext.Foo
    End Sub

    Public Shared Sub Main
      Dim x As New Bar
      x.F
    End Sub
  End Class
End NameSpace
Olga Lobacheva
  Olga Lobacheva
02 Nov 2009 23:31
2 years ago
Extension method with more applicable argument types is better even though it is less 'closer' then another method.
Olga Lobacheva
  Olga Lobacheva
11 Feb 2010 19:12
2 years ago
Related Changes
Priority
Show-stopperCritical
Fixed In version
<lost change><lost change>