Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
627 additions
and
63 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
module TypeSpec where | ||
|
||
import Common | ||
import TestLib | ||
|
||
import Language.PlutusCore.Quote | ||
|
||
import qualified Language.PlutusCore as PLC | ||
import Language.PlutusIR.Parser | ||
import qualified Language.PlutusIR.Transform.LetFloat as LetFloat | ||
import qualified Language.PlutusIR.Transform.NonStrict as NonStrict | ||
import Language.PlutusIR.Transform.Rename () | ||
import qualified Language.PlutusIR.Transform.ThunkRecursions as ThunkRec | ||
|
||
types :: TestNested | ||
types = testNested "types" | ||
$ map (goldenTypeFromPir term) | ||
[ "letInLet" | ||
,"listMatch" | ||
,"maybe" | ||
,"ifError" | ||
,"mutuallyRecursiveTypes" | ||
,"mutuallyRecursiveValues" | ||
,"nonrec1" | ||
,"nonrec2" | ||
,"nonrec3" | ||
,"nonrec4" | ||
,"nonrec6" | ||
,"nonrec7" | ||
,"nonrec8" | ||
,"rec1" | ||
,"rec2" | ||
,"rec3" | ||
,"rec4" | ||
,"nonrecToRec" | ||
,"nonrecToNonrec" | ||
,"oldLength" | ||
,"strictValue" | ||
,"strictNonValue" | ||
,"strictNonValue2" | ||
,"strictNonValue3" | ||
,"strictValueNonValue" | ||
,"strictValueValue" | ||
,"even3Eval" | ||
,"sameNameDifferentEnv" | ||
] | ||
|
||
typeErrors :: TestNested | ||
typeErrors = testNested "type-errors" | ||
$ map (goldenTypeFromPirCatch term) | ||
[ "conflictingRecursiveBinds" | ||
, "duplicateDataConstrs" | ||
, "duplicateTypeConstrs" | ||
, "wrongDataConstrReturnType" | ||
] |
File renamed without changes.
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 @@ | ||
Error during compilation: Type bindings cannot appear in recursive let, use datatypebind instead((recursive) let binding; from recursiveTypeBind:1:2) |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
(lam x (con integer) | ||
(let | ||
(rec) | ||
(termbind (strict) (vardecl j (con integer)) (con 3)) | ||
(termbind (strict) (vardecl j (con integer)) (con 3)) | ||
(con 5) | ||
) | ||
) | ||
|
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 @@ | ||
(fun (con integer) (con integer)) |
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 @@ | ||
(let | ||
(nonrec) | ||
(datatypebind | ||
(datatype | ||
(tyvardecl Maybe (fun (type) (type))) | ||
(tyvardecl a (type)) | ||
match_Maybe | ||
(vardecl Nothing [Maybe a]) | ||
(vardecl Just (fun a [Maybe a])) | ||
(vardecl Just [Maybe a]) | ||
) | ||
) | ||
(con 5) | ||
) |
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 @@ | ||
Error from the PIR typechecker: |
Oops, something went wrong.