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

Merge release/dev17.11 to release/dev17.12 #18105

Open
wants to merge 8 commits into
base: release/dev17.12
Choose a base branch
from
1 change: 1 addition & 0 deletions src/Compiler/AbstractIL/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,7 @@ and typeDefReader ctxtH : ILTypeDefStored =
ctxt.fileName.EndsWith("System.Runtime.dll")
|| ctxt.fileName.EndsWith("mscorlib.dll")
|| ctxt.fileName.EndsWith("netstandard.dll")
|| ctxt.fileName.EndsWith("System.Private.CoreLib.dll")

while attrIdx <= attrsEndIdx && not containsExtensionMethods do
let mutable addr = ctxt.rowAddr TableNames.CustomAttribute attrIdx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,22 @@ tInput.Length
let value = opt.Value
Assert.Equal(4L, downcast value.ReflectionValue)

[<FSharp.Test.FactForNETCOREAPP>] // usessdkrefs is not a valid option for desktop compiler
member _.``ML - use assembly with ref dependencies and without refing SMemory``() =
let code = """
#r "nuget:Microsoft.ML.OnnxTransformer,1.4.0"

open System
open System.Numerics.Tensors
let inputValues = [| 12.0; 10.0; 17.0; 5.0 |]
let tInput = new DenseTensor<float>(inputValues.AsMemory(), new ReadOnlySpan<int>([|4|]))
tInput.Length
"""
use script = new FSharpScript(additionalArgs=[| "/usesdkrefs-" |])
let opt = script.Eval(code) |> getValue
let value = opt.Value
Assert.Equal(4L, downcast value.ReflectionValue)

[<Fact>]
member _.``System.Device.Gpio - Ensure we reference the runtime version of the assembly``() =
let code = """
Expand Down
Loading