Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15406

Compiler bug

$
0
0
Greetings,

Yes I made a mistake but I got bitten hard by this in production yesterday.



Create an empty project

In the form load:

dim someObject as object

set someObject = createobject("any.valid.object")

Create an empty function someFunction in form that accepts no arguments

In the form load

someFunction someObject

compile & run

Boom

Access violation.

Why does it even compile?

EDIT

If you make someFunction have a return value like "as boolean" then it no longer compiles

EDIT EDIT

if define someFuncion as a sub instead of a function it also does not compile.

Viewing all articles
Browse latest Browse all 15406

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>