2010-12-30 10 views
0

내가 VS2010에서 다음 코드를 시도했다 :F # 대화 형 버그?

open System.Security.Cryptography 

let rsaTest1 = 
    let ecKey = [|0uy..143uy|] // junk data for testing 

    let ecKeyMod = ecKey.[8..8+128-1] 
    let ecKeyExp = ecKey.[136..136+8-1] 
    let rsa = RSAParameters(Modulus = ecKeyMod, Exponent = ecKeyExp) 

    rsa 


let rsaTest2 = 
    let ecKey = [|0uy..143uy|] // junk data for testing 

    let rsa = RSAParameters(Modulus = ecKey.[8..8+128-1], Exponent = ecKey.[136..136+8-1]) 

    rsa 

나는 모든 코드를 강조하고, 다음 rsaTest1가 작동하지만 rsaTest2 오류 메시지가 제공 F # 대화에 (Alt 키를 + 입력)를 보내는 경우,

I 함수로 rsaTest2 값으로부터 변경하고,

let rsaTest2() = 
    let ecKey = [|0uy..143uy|] // junk data for testing 
    let rsa = RSAParameters(Modulus = ecKey.[8..8+128-1], Exponent = ecKey.[136..136+8-1]) 
    rsa 

let x = rsaTest2() 

를 호출하는 경우

System.NullReferenceException: Object reference not set to an instance of an object. 
    at <StartupCode$FSI_0004>[email protected]() in P:\proj\Tachograph\Project\CompuTachTest\CompuTachTest\rsaTest.fsx:line 16 

그러나, 다음 에러가 없다. F # 버그 또는 실수?

Unhandled Exception: System.InvalidProgramException: Common Language Runtime detected an invalid program. 
at <StartupCode$test>[email protected]() 

을이 x86 용 : -

답변

5

이 버그가 가장 가능성이 당신이 FSC에 게시 된 조각을 컴파일하고 실행하면, 당신은 64이 얻을

Unhandled Exception: System.InvalidProgramException: JIT Compiler encountered an internal limitation. 
at <StartupCode$test>[email protected]() 

당신이해야 Microsoft Connect를 통해보고하십시오.

+0

나는 무슨 일이 있었는지에 대해 논평하는 것을 깜빡했으나 여기에 간다. MS에 버그를보고했고 Don Syme이 그것을 확인했다. –