Operating System: Win 7 x86-64
Compiler Version: Cobra 0.9.4
IDE: Xamarin - latest
- Code: Select all
@args -lib:"C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86"
@ref 'Microsoft.Xna.Framework.Graphics'
use Microsoft.Xna.Framework.Graphics
class Program
var blendState as Microsoft.Xna.Framework.Graphics.BlendState
def main
.blendState = BlendState()
.blendState.AlphaBlendFunction = BlendState.AlphaBlend.AlphaBlendFunction
.blendState.AlphaDestinationBlend = BlendState.AlphaBlend.AlphaDestinationBlend
.blendState.AlphaSourceBlend = BlendState.AlphaBlend.AlphaSourceBlend
.blendState.BlendFactor = BlendState.AlphaBlend.BlendFactor
.blendState.ColorBlendFunction = BlendState.AlphaBlend.ColorBlendFunction
.blendState.ColorDestinationBlend = BlendState.AlphaBlend.ColorDestinationBlend
.blendState.ColorSourceBlend = BlendState.AlphaBlend.ColorSourceBlend
.blendState.ColorWriteChannels = BlendState.AlphaBlend.ColorWriteChannels
#.blendState.ColorWriteChannels1 = BlendState.AlphaBlend.ColorWriteChannels1
Compilation of this incorrect code simply reports the errors. However, if the last line is uncommented, the compiler will completely lock up and the IDE then has to be closed (compilation cannot be cancelled).
To prove that this is not a case that involves only XNA, the following code will also cause a lock-up:
- Code: Select all
class Program
def main
variable = 15
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
variable = 'x'
The second code is obviously an extreme corner-case, but it proves that you can lock the compiler up with any code.