I was quickly copying code from something else. Upon testing and debugging, I kept getting really strange results. After comparing the code again, I realized that I had added an extra = inside of my equation:
Dim lowerLeft As Integer = x = +y * terrainWidth
as opposed to this:
Dim lowerLeft As Integer = x + y * terrainWidth
What was this actually doing?
If you had
Option Strict On(and you should), this wouldn’t compile.A
=inside an expression is a comparison operator. Its result is aBoolean. In your case, this means the expression is equivalent to:Option Strict Onrightly forbids this implicit conversion.