-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix record constructors in guards using non-aliased names
- Loading branch information
Showing
5 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...x_core__nix__tests__case_clause_guards__custom_type_constructor_imported_and_aliased.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: compiler-core/src/nix/tests/case_clause_guards.rs | ||
expression: "import other_module.{A as B}\nfn func() {\n case B {\n x if x == B -> True\n _ -> False\n }\n}\n" | ||
--- | ||
let | ||
other_module' = builtins.import ./../../package/other_module.nix; | ||
B = (builtins.import ./../../package/other_module.nix).A; | ||
|
||
func = | ||
{ }: let _pat' = B; in if _pat' == B then let x = _pat'; in true else false; | ||
in | ||
{ } |
14 changes: 14 additions & 0 deletions
14
...ix/tests/snapshots/glistix_core__nix__tests__case_clause_guards__imported_aliased_ok.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: compiler-core/src/nix/tests/case_clause_guards.rs | ||
expression: "import gleam.{Ok as Y}\npub type X {\n Ok\n}\nfn func() {\n case Y {\n y if y == Y -> True\n _ -> False\n }\n}\n" | ||
--- | ||
let | ||
gleam' = builtins.import ./../gleam.nix; | ||
Y = (builtins.import ./../gleam.nix).Ok; | ||
|
||
Ok = { __gleamTag = "Ok"; }; | ||
|
||
func = | ||
{ }: let _pat' = Y; in if _pat' == Y then let y = _pat'; in true else false; | ||
in | ||
{ inherit Ok; } |
19 changes: 19 additions & 0 deletions
19
...re/src/nix/tests/snapshots/glistix_core__nix__tests__case_clause_guards__imported_ok.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
source: compiler-core/src/nix/tests/case_clause_guards.rs | ||
expression: "import gleam\npub type X {\n Ok\n}\nfn func(x) {\n case gleam.Ok {\n _ if [] == [ gleam.Ok ] -> True\n _ -> False\n }\n}\n" | ||
--- | ||
let | ||
gleam' = builtins.import ./../gleam.nix; | ||
inherit (builtins.import ./../gleam.nix) toList; | ||
|
||
Ok = { __gleamTag = "Ok"; }; | ||
|
||
func = | ||
x: | ||
let | ||
_pat' = gleam'.Ok; | ||
in | ||
if (toList [ ]) == (toList [ gleam'.Ok ]) then true | ||
else false; | ||
in | ||
{ inherit Ok; } |