Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quotation of readonly fields #622

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,24 @@ 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.*
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/
tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Utils.dll
tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExprLibrary.dll

*.csproj.user
*.sln.DotSettings.user

*.ide
*.log
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/QuotationTranslator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions tests/fsharp/.gitignore
Original file line number Diff line number Diff line change
@@ -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

53 changes: 53 additions & 0 deletions tests/fsharp/core/.gitignore
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions tests/fsharp/core/quotes/cslib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
8 changes: 8 additions & 0 deletions tests/fsharp/core/quotes/test.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

(*
Expand Down
14 changes: 14 additions & 0 deletions tests/fsharp/optimize/.gitignore
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests/fsharp/perf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

graph/tmptest*

nbody/tmptest*
22 changes: 22 additions & 0 deletions tests/fsharp/regression/.gitignore
Original file line number Diff line number Diff line change
@@ -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*
38 changes: 38 additions & 0 deletions tests/fsharp/typeProviders/.gitignore
Original file line number Diff line number Diff line change
@@ -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

29 changes: 29 additions & 0 deletions tests/fsharp/typeProviders/builtin/.gitignore
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions tests/fsharp/typecheck/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sigs/*.err
sigs/*.vserr
sigs/pos*.dll
sigs/pos*.exe

full-rank-arrays/HighRankArrayTests.dll

misc/tmptest*