Skip to content
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

ExtractInterface: Missing parameters in Interface signatures - Optional parameters only #4774

Closed
ghost opened this issue Feb 6, 2019 · 1 comment · Fixed by #5387
Closed
Assignees
Labels
bug Identifies work items for known bugs difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. feature-refactorings up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky

Comments

@ghost
Copy link

ghost commented Feb 6, 2019

Rubberduck version information
Version 2.4.0.4511
OS: Microsoft Windows NT 10.0.17763.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.11231.20130
Host Executable: WINWORD.EXE

Description
RubberDuck.Refactor.ExtractInterface gives rise to some methods of the the interface class having no parameters in the method declaration if the originating method has optional arguments.

In the implementation inserted in the class from which the interface was extracted, the method signature does include the parameters but omits the Optional clause in the signature.

Source Method

Public Property Get AsItemTypeValueStr(Optional ByVal this_property As String = "Item") As String

    proj.Log.Trace _
        is_module, "{0}.{1}", _
        s.name, _
        ErrEx.LiveCallstack.ProcedureName

    ' Overloading VBA style
    If LenB(this_property) = 0 Then
        AsItemTypeValueStr = AsItemTypeValueStringNoOpt
    Else
        AsItemTypeValueStr = AsItemTypeValueStringWithOpt(this_property)
    End If

End Property

Implementation

Private Property Get ITestXmlPair_AsItemTypeValueStr(ByVal this_property As String) As String
    Err.Raise 5 'TODO implement interface member
End Property

Interface

Public Property Get AsItemTypeValueStr() As String
End Property

Logfile
RubberduckLog.txt

Additional context

TestXmlPair.zip

@ghost ghost added the bug Identifies work items for known bugs label Feb 6, 2019
@comintern
Copy link
Contributor

This is apparently also an issue with Implement Interface, and ParamArray is also dropped.

@comintern comintern added feature-refactorings up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. labels Feb 6, 2019
@Vogel612 Vogel612 added the hacktoberfest Tags issues for Hacktoberfest 2019 label Sep 20, 2019
@bclothier bclothier removed the hacktoberfest Tags issues for Hacktoberfest 2019 label Nov 5, 2019
@MDoerner MDoerner self-assigned this Feb 19, 2020
Semi-automatic bug tracker automation moved this from ToDo to Done Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. feature-refactorings up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
Projects
Development

Successfully merging a pull request may close this issue.

4 participants