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

Code inspection result "Object variable 'foo' is assigned without 'Set' keyword" #5023

Closed
SmileyFtW opened this issue Jun 26, 2019 · 3 comments
Labels
support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask!

Comments

@SmileyFtW
Copy link

SmileyFtW commented Jun 26, 2019

I've been implementing some concepts I read on the WordPress site and one in particular:

Public Property Get Foo () as Object
   Set Foo = this.foo
End Property
Public Property Let Foo (byval obj as Object)
   Set this.foo = obj
End Property

This arrangement throws the subject code inspection.
Is using the Set inside of Property Get/Let the wrong way to do it?
Thanks!
Miley

@SmileyFtW SmileyFtW added the support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask! label Jun 26, 2019
@retailcoder
Copy link
Member

That should be a Property Set member, but the inspection is confused regardless (a number of issues are open for it), presumably because of the UDT-member nature of foo here.

@SmileyFtW
Copy link
Author

Thanks, Mathieu.... then I'd suggest saying something about it in the examples on the WP site. Specifically the "There is no workbook" and related posts that use that convention... I'll change my Lets to Sets for objects.
On a side note, I wrote something over the weekend for a friend's golf outing using most of what I've learned from the RD community. After the project was "in the can" and ready to go; he let me know, "Oh yeah I forgot to tell you I need it to do "this" too..." Whoops. Well, because of the structured way you've taught me, the "new stuff" took lest than an hour (more like 20-30 minutes) to implement and test. Friggen' AWESOME!

@bclothier
Copy link
Contributor

Since we have #4318 , we can use that to track the issue. Thanks for reporting and feel free to open new issue for additional feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Whether you're using Rubberduck or you've forked it and have questions, never hesitate to ask!
Projects
None yet
Development

No branches or pull requests

3 participants