From 777fc3d0554e79944b6dc59074770f71fc7fb105 Mon Sep 17 00:00:00 2001 From: enricosada Date: Tue, 8 Sep 2015 14:54:08 +0200 Subject: [PATCH 1/2] fix quotation of readonly fields --- src/fsharp/QuotationTranslator.fs | 1 + tests/fsharp/core/quotes/cslib.cs | 7 +++++++ tests/fsharp/core/quotes/test.fsx | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/src/fsharp/QuotationTranslator.fs b/src/fsharp/QuotationTranslator.fs index 04256710404..3c77f295703 100644 --- a/src/fsharp/QuotationTranslator.fs +++ b/src/fsharp/QuotationTranslator.fs @@ -444,6 +444,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. QP.mkTupleGet(tyR, n, ConvExpr cenv env e) | TOp.ILAsm(([ I_ldfld(_,_,fspec) ] + | [ I_ldfld(_,_,fspec); AI_nop ] | [ I_ldsfld (_,fspec) ] | [ I_ldsfld (_,fspec); AI_nop ]),_),enclTypeArgs,args -> ConvLdfld cenv env m fspec enclTypeArgs args diff --git a/tests/fsharp/core/quotes/cslib.cs b/tests/fsharp/core/quotes/cslib.cs index a0a73731bb9..97a456275d7 100644 --- a/tests/fsharp/core/quotes/cslib.cs +++ b/tests/fsharp/core/quotes/cslib.cs @@ -2,3 +2,10 @@ public struct S { public int x; } + +public class Class1 +{ + public string myField; + public readonly string myReadonlyField; + public Class1(string v) { this.myReadonlyField = v; } +} diff --git a/tests/fsharp/core/quotes/test.fsx b/tests/fsharp/core/quotes/test.fsx index 5ac45dc8002..dcc5a213925 100644 --- a/tests/fsharp/core/quotes/test.fsx +++ b/tests/fsharp/core/quotes/test.fsx @@ -528,6 +528,14 @@ module TypedTest = begin | _ -> false end + test "check accesses to readonly fields in ReflectedDefinitions" + begin + let c1 = Class1("a") + match <@ c1.myReadonlyField @> with + | FieldGet(Some (ValueWithName (_, v, "c1")), field) -> (v.Name = "Class1") && (field.Name = "myReadonlyField") + | _ -> false + end + end (* From 4b7c383959eb285e537827b513f18fb1dd79c644 Mon Sep 17 00:00:00 2001 From: enricosada Date: Tue, 8 Sep 2015 15:02:14 +0200 Subject: [PATCH 2/2] ignore generated files of 'tests/fsharp' test suite run --- .gitignore | 14 +---- tests/fsharp/.gitignore | 16 ++++++ tests/fsharp/core/.gitignore | 53 +++++++++++++++++++ tests/fsharp/optimize/.gitignore | 14 +++++ tests/fsharp/perf/.gitignore | 4 ++ tests/fsharp/regression/.gitignore | 22 ++++++++ tests/fsharp/typeProviders/.gitignore | 38 +++++++++++++ tests/fsharp/typeProviders/builtin/.gitignore | 29 ++++++++++ tests/fsharp/typecheck/.gitignore | 8 +++ 9 files changed, 185 insertions(+), 13 deletions(-) create mode 100644 tests/fsharp/.gitignore create mode 100644 tests/fsharp/core/.gitignore create mode 100644 tests/fsharp/optimize/.gitignore create mode 100644 tests/fsharp/perf/.gitignore create mode 100644 tests/fsharp/regression/.gitignore create mode 100644 tests/fsharp/typeProviders/.gitignore create mode 100644 tests/fsharp/typeProviders/builtin/.gitignore create mode 100644 tests/fsharp/typecheck/.gitignore diff --git a/.gitignore b/.gitignore index b1a739b148d..26c9da97535 100644 --- a/.gitignore +++ b/.gitignore @@ -66,12 +66,6 @@ tests/projects/Sample_VS2012_FSharp_ConsoleApp_net45_with_resource/Sample_VS2012 obj extras ossreadme*.txt -tests/fsharp/typecheck/sigs/*.exe -tests/fsharp/typecheck/sigs/*.diff -tests/fsharp/typecheck/sigs/*.err -tests/fsharp/typecheck/sigs/*.vsdiff -tests/fsharp/typecheck/sigs/*.dll -tests/fsharp/typecheck/sigs/*.vserr src/fsharp/FSharp.LanguageService.Compiler/illex.* src/fsharp/FSharp.LanguageService.Compiler/ilpars.* src/fsharp/FSharp.LanguageService.Compiler/lex.* @@ -79,16 +73,9 @@ src/fsharp/FSharp.LanguageService.Compiler/pars.* src/fsharp/FSharp.LanguageService.Compiler/pplex.fs src/fsharp/FSharp.LanguageService.Compiler/pppars.fs src/fsharp/FSharp.LanguageService.Compiler/pppars.fsi -tests/fsharp/typecheck/sigs/*.dll -tests/fsharp/typecheck/sigs/*.exe -tests/fsharp/typeProviders/builtin/SqlDataConnection/DataDirectory/ -tests/fsharp/typeProviders/builtin/SqlDataConnection/ExampleResolutionFolder/ -tests/fsharp/typeProviders/builtin/SqlEntityConnection/DataDirectory/ vsintegration/src/unittests/Unittests.fsi tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.dll tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Module01.pdb -tests/fsharp/typeProviders/helloWorld/bincompat1/ -tests/fsharp/typeProviders/helloWorld/bincompat2/ tests/XFSharpQA_Failures.log.* vsintegration/src/vs/FsPkgs/FSharp.Project/FS/FSharp.ProjectSystem.FSharp.fsi vsintegration/src/vs/FsPkgs/FSharp.Project/FS/ctofiles/ @@ -96,6 +83,7 @@ tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Utils.dll tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLibrary.dll *.csproj.user +*.sln.DotSettings.user *.ide *.log diff --git a/tests/fsharp/.gitignore b/tests/fsharp/.gitignore new file mode 100644 index 00000000000..0493c881790 --- /dev/null +++ b/tests/fsharp/.gitignore @@ -0,0 +1,16 @@ +build.ok +test.ok +test*.exe +test*.pdb +test*.dll +failures.log + +lib*.dll +lib*.pdb +lib*.xml + +Library1.dll + + +cd.tmp + diff --git a/tests/fsharp/core/.gitignore b/tests/fsharp/core/.gitignore new file mode 100644 index 00000000000..e395d5b7827 --- /dev/null +++ b/tests/fsharp/core/.gitignore @@ -0,0 +1,53 @@ + +forwarders/orig +forwarders/split + +queriesCustomQueryOps/negativetest.err +queriesCustomQueryOps/negativetest.vserr + +printing/z.output.test.*.txt +printing/z.raw.output.test.*.txt +printing/z.output.test.*.diff + +quotes/cslib.dll + +parsing/crlf.dll +parsing/crlf.pdb +parsing/toplet.exe +parsing/toplet.pdb + +unicode/kanji-unicode-*.dll +unicode/kanji-unicode-*.pdb +unicode/out?.txt + +internalsvisible/main.exe + +hiding/client.exe + +load-script/out.txt +load-script/usesfsi.exe + +queriesOverOData/schema?.csdl + +quotesInMultipleModules/module1.dll +quotesInMultipleModules/module1-opt.dll +quotesInMultipleModules/module2.exe +quotesInMultipleModules/module2-opt.exe + +resources/Resources.resources + +topinit/app69514.exe +topinit/app69514.pdb +topinit/app69514-noopt.exe +topinit/app69514-noopt.pdb +topinit/app69514-noopt-withsig.exe +topinit/app69514-noopt-withsig.pdb +topinit/app69514-withsig.exe +topinit/app69514-withsig.pdb +topinit/both69514.exe +topinit/both69514.pdb +topinit/both69514-noopt.exe +topinit/both69514-noopt.pdb + +verify/xmlverify.exe +verify/xmlverify.pdb diff --git a/tests/fsharp/optimize/.gitignore b/tests/fsharp/optimize/.gitignore new file mode 100644 index 00000000000..2de025a1737 --- /dev/null +++ b/tests/fsharp/optimize/.gitignore @@ -0,0 +1,14 @@ + +analyses/sizes.exe +analyses/effects.exe +analyses/tailcalls.exe +analyses/*.output.test.txt + +inline/FSharpOptimizationData.* +inline/FSharpSignatureData.* +inline/*.il +inline/*.res + +stats/*.resources +stats/*.il +stats/*.res diff --git a/tests/fsharp/perf/.gitignore b/tests/fsharp/perf/.gitignore new file mode 100644 index 00000000000..0255825e78f --- /dev/null +++ b/tests/fsharp/perf/.gitignore @@ -0,0 +1,4 @@ + +graph/tmptest* + +nbody/tmptest* diff --git a/tests/fsharp/regression/.gitignore b/tests/fsharp/regression/.gitignore new file mode 100644 index 00000000000..85ae0bfc163 --- /dev/null +++ b/tests/fsharp/regression/.gitignore @@ -0,0 +1,22 @@ + +26/tmptest* + +321/tmptest* + +655/pack.dll +656/pack.exe + +83/tmptest* + +84/tmptest* + +85/petshop.dll + +86/tmptest* + +ml-1/dbwlib2.dll +ml-1/dbwlib2--optimize.dll +ml-1/main.exe +ml-1/main--optimize.exe + +tuple-bug-1/tmptest* diff --git a/tests/fsharp/typeProviders/.gitignore b/tests/fsharp/typeProviders/.gitignore new file mode 100644 index 00000000000..204f668cfdd --- /dev/null +++ b/tests/fsharp/typeProviders/.gitignore @@ -0,0 +1,38 @@ +diamondAssembly/provided.dll +diamondAssembly/provider.dll + +globalNamespace/globalNamespaceTP.dll +globalNamespace/globalNamespaceTP.pdb + +helloWorld/provided.dll +helloWorld/provided.pdb +helloWorld/provided?.dll +helloWorld/provided?.pdb +helloWorld/providedNullAssemblyName.dll +helloWorld/providedNullAssemblyName.pdb +helloWorld/provider.dll +helloWorld/bincompat1 +helloWorld/bincompat2 + +helloWorldCSharp/magic.dll +helloWorldCSharp/provider.dll + +negTests/*.dll +negTests/*.bsl +negTests/*.err +negTests/*.vserr +negTests/*.vsbsl +negTests/*.diff +negTests/*.vsdiff + +splitAssembly/provider.dll +splitAssembly/providerDesigner.dll + +wedgeAssembly/provided.dll +wedgeAssembly/providedJ.dll +wedgeAssembly/providedK.dll +wedgeAssembly/provider.dll + +builtin/SqlDataConnection/DataDirectory +builtin/SqlDataConnection/ExampleResolutionFolder + diff --git a/tests/fsharp/typeProviders/builtin/.gitignore b/tests/fsharp/typeProviders/builtin/.gitignore new file mode 100644 index 00000000000..760ee5a8826 --- /dev/null +++ b/tests/fsharp/typeProviders/builtin/.gitignore @@ -0,0 +1,29 @@ + +FSharp.Data.TypeProviders.dll + +EdmxFile/SampleModel01.edmx + +EdmxFile/*.exe.config +EdmxFile/*.dll.config + +ODataService/*.exe.config +ODataService/*.dll.config +ODataService/svc.csdl +ODataService/svc2.csdl + +SqlDataConnection/*.exe.config +SqlDataConnection/*.dll.config +SqlDataConnection/app.config +SqlDataConnection/NORTHWND.mdf +SqlDataConnection/NORTHWND_log.ldf +SqlDataConnection/nwind2.dbml +SqlDataConnection/nwind3.dbml +SqlDataConnection/test.config + +SqlEntityConnection/*.exe.config +SqlEntityConnection/*.dll.config + +WsdlService/*.exe.config +WsdlService/*.dll.config +WsdlService/sfile.wsdlschema +WsdlService/sfile2.wsdlschema diff --git a/tests/fsharp/typecheck/.gitignore b/tests/fsharp/typecheck/.gitignore new file mode 100644 index 00000000000..4bfefa6abed --- /dev/null +++ b/tests/fsharp/typecheck/.gitignore @@ -0,0 +1,8 @@ +sigs/*.err +sigs/*.vserr +sigs/pos*.dll +sigs/pos*.exe + +full-rank-arrays/HighRankArrayTests.dll + +misc/tmptest*