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

More Seq tests #2647

Merged
merged 2 commits into from
Dec 9, 2021
Merged
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
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/src/Fable.Cli/bin/Debug/net5.0/fable.dll",
"args": ["--outDir", "${workspaceRoot}/build/fable-library-rust/src", "--fableLib", ".", "--exclude", "Fable.Core", "--lang", "Rust"],
"args": ["--outDir", "${workspaceRoot}/build/fable-library-rust/src", "--fableLib", ".", "--exclude", "Fable.Core", "--lang", "Rust", "--define", "FABLE_LIBRARY"],
"cwd": "${workspaceRoot}/src/fable-library-rust/src",
"stopAtEntry": false,
"console": "internalConsole"
Expand Down
7 changes: 4 additions & 3 deletions src/Fable.Transforms/Rust/Fable2Rust.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ module Util =
// rest @ [Expression.spreadElement(com.TransformAsExpr(ctx, last))]
| args ->
if isNative then
args |> List.map (fun arg -> com.TransformAsExpr (ctx, arg))
args |> List.map (fun arg -> transformExprMaybeUnwrapRef com ctx arg)
elif ctx.Typegen.TakingOwnership then
args |> List.map (transformLeaveContextByValue com ctx None None)
else
Expand Down Expand Up @@ -3305,7 +3305,8 @@ module Util =

let getIgnoredNames (name: string option) (args: Fable.Ident list) =
let argNames = args |> List.map (fun arg -> arg.Name)
let allNames = name |> Option.fold (fun xs x -> x :: xs) argNames
let fixedNames = ["matchValue"]
let allNames = name |> Option.fold (fun xs x -> x :: xs) (argNames @ fixedNames)
allNames |> Set.ofList

let hasCapturedNames com ctx (name: string option) (args: Fable.Ident list) (body: Fable.Expr) =
Expand Down Expand Up @@ -3919,7 +3920,7 @@ module Util =
|> Fable.Path.normalizeFullPath

let isFableLibrary (com: IRustCompiler) =
List.contains "FABLE_LIBRARY" com.Options.Define
List.contains "FABLE_LIBRARY" com.Options.Define //TODO: does not look in project defines

let isFableLibraryImport (com: IRustCompiler) (path: string) =
not (isFableLibrary com) && path.StartsWith(com.LibraryDir)
Expand Down
4 changes: 2 additions & 2 deletions src/fable-library-rust/src/Fable.Library.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
<!-- <Compile Include="Async.fs" /> -->

<Compile Include="Option.fs" />
<Compile Include="Array.fs" />
<Compile Include="Seq.fs" />
<Compile Include="List.fs" />
<Compile Include="Array.fs" />
<Compile Include="Util.fs" />
<Compile Include="lib.fs" />
<Compile Include="Seq.fs" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading