vblang icon indicating copy to clipboard operation
vblang copied to clipboard

Strange “type of”

Open kingtu opened this issue 4 years ago • 3 comments

I have a piece of code, as shown in the figure below. 神奇的赋值

Why isbill is “false” ? If the type of c is form, the above situation will occur; Not if the type of c is control.

kingtu avatar Oct 31 '21 14:10 kingtu

If you look through the issues in this repo, you will find a few discussions about TypeOf, and how its behaviour is not always what people expect.

pricerc avatar Nov 05 '21 22:11 pricerc

@kingtu

Could this be an issue about the debugger and the Watch window? I would suggest using the Quick Watch and the Immediate windows, and see what they display for TypeOf c Is IBill and isBill. You can also use them to confirm that c actually contains a reference to some object which implements IBill.

I suspect that the TypeOf operator is working as it should, but that the Watch window might not be getting properly updated (and hence making TypeOf c Is IBill and isBill seem out of sync).

rskar-git avatar Nov 08 '21 17:11 rskar-git

Is this... using the full-width keywords of legend?

AnthonyDGreen avatar Jun 11 '22 04:06 AnthonyDGreen