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

No warning if calling undefined method or property #142

Closed
dmrvb opened this issue May 12, 2021 · 3 comments
Closed

No warning if calling undefined method or property #142

dmrvb opened this issue May 12, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@dmrvb
Copy link

dmrvb commented May 12, 2021

Calling a non existent method or property in an object gives NO warning at edit time or at compile time, but gives "Unknown Name" error at runtime.

This is BAD, I need to catch errors like this before my customers!!

To Reproduce
Insert this code and note the D.yyy=10

Module Dave
Public Sub Main()
dim D as new DaveObj

    on error goto e
    D.yyy=10
    
exit sub

e:
call msgbox(Format$(Err.Number) & " " & err.Description )    
      
End Sub

End Module

class DaveObj

public xxx as long

end class

Expected behavior
I want to see this problem reported whilst editing, or at least while compiling

Desktop (please complete the following information):

  • OS: Windows 10
  • twinBASIC compiler version 0.9.2720
@WaynePhillipsEA
Copy link
Collaborator

We are aware of this one, but there was no issue opened for it, so thanks for reporting. Classes are currently seen (wrongly) as runtime extensible, that's why you don't see an error at compiler time.

@WaynePhillipsEA WaynePhillipsEA added the bug Something isn't working label May 12, 2021
@wqweto
Copy link

wqweto commented May 13, 2021

Classes are currently seen (wrongly) as runtime extensible

Btw, ADODB.Connection is deliberately missing nonextensible attribute so that one can call stored procedures with cn.MyStoredProc Param1, Param2, ... syntax in VB code.

It might be good candidate for testing nonextensible attribute implementation.

@WaynePhillipsEA
Copy link
Collaborator

Fixed in v0.10.509, thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants