Skip to content

Commit

Permalink
test: updating identity test result
Browse files Browse the repository at this point in the history
  • Loading branch information
BRonen committed Feb 13, 2024
1 parent d328c1d commit af899fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/snapshots/identity.output
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
tokens:

[TokenType,TokenLiteral "Id",TokenEq,TokenOB,TokenLiteral "String",TokenArrow,TokenLiteral "String",TokenCB,TokenAmpersand,TokenOB,TokenLiteral "Int",TokenArrow,TokenLiteral "Int",TokenCB,TokenAmpersand,TokenOB,TokenLiteral "Bool",TokenArrow,TokenLiteral "Bool",TokenCB,TokenIn,TokenLet,TokenLiteral "id",TokenEq,TokenOB,TokenLiteral "x",TokenColon,TokenLiteral "String",TokenPipe,TokenLiteral "Int",TokenPipe,TokenLiteral "Bool",TokenCB,TokenFatArrow,TokenLiteral "x",TokenIn,TokenLet,TokenLiteral "_",TokenEq,TokenLiteral "id",TokenQuote,TokenString "hello world",TokenQuote,TokenIn,TokenLet,TokenLiteral "_",TokenEq,TokenLiteral "id",TokenBool True,TokenIn,TokenLiteral "id",TokenInt 1]
[TokenType,TokenLiteral "Id",TokenEq,TokenOB,TokenLiteral "String",TokenArrow,TokenLiteral "String",TokenCB,TokenAmpersand,TokenOB,TokenLiteral "Int",TokenArrow,TokenLiteral "Int",TokenCB,TokenAmpersand,TokenOB,TokenLiteral "Bool",TokenArrow,TokenLiteral "Bool",TokenCB,TokenIn,TokenLet,TokenLiteral "id",TokenColon,TokenLiteral "Id",TokenEq,TokenOB,TokenLiteral "x",TokenColon,TokenLiteral "String",TokenPipe,TokenLiteral "Bool",TokenPipe,TokenLiteral "Int",TokenCB,TokenFatArrow,TokenLiteral "x",TokenIn,TokenLet,TokenLiteral "_",TokenEq,TokenLiteral "id",TokenQuote,TokenString "hello world",TokenQuote,TokenIn,TokenLet,TokenLiteral "_",TokenEq,TokenLiteral "id",TokenBool True,TokenIn,TokenLiteral "id",TokenInt 1]

ast:

STypeAlias "Id" (STypeIntersection (STypeFunc (SType "String") (SType "String")) (STypeIntersection (STypeFunc (SType "Int") (SType "Int")) (STypeFunc (SType "Bool") (SType "Bool")))) (SLetInfer "id" (SDefInfer "x" (STypeUnion (SType "String") (STypeUnion (SType "Int") (SType "Bool"))) (SName "x")) (SLetInfer "_" (SApp (SName "id") (SString "hello world")) (SLetInfer "_" (SApp (SName "id") (SBool True)) (SApp (SName "id") (SInt 1)))))
STypeAlias "Id" (STypeIntersection (STypeFunc (SType "String") (SType "String")) (STypeIntersection (STypeFunc (SType "Int") (SType "Int")) (STypeFunc (SType "Bool") (SType "Bool")))) (SLet "id" (SType "Id") (SDefInfer "x" (STypeUnion (SType "String") (STypeUnion (SType "Bool") (SType "Int"))) (SName "x")) (SLetInfer "_" (SApp (SName "id") (SString "hello world")) (SLetInfer "_" (SApp (SName "id") (SBool True)) (SApp (SName "id") (SInt 1)))))

type:
check err:

TUnion TString (TUnion TInt TBool)
"Var<id> of type <TIntersection (TFunction TString TString) (TIntersection (TFunction TInt TInt) (TFunction TBool TBool))> trying to be assigned with <TFunction (TUnion TString (TUnion TBool TInt)) (TUnion TString (TUnion TBool TInt))>"
2 changes: 1 addition & 1 deletion test/snapshots/identity.pog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type Id = (String -> String) & (Int -> Int) & (Bool -> Bool) in
let id = (x: String | Int | Bool) => x in
let id: Id = (x: String | Int | Bool) => x in
let _ = id "hello world" in
let _ = id True in
id 1

0 comments on commit af899fa

Please sign in to comment.