roc/test/snapshots/expr/tuple_unification_test.md
2025-11-23 01:22:01 -05:00

972 B

META

description=Tuple unification with different types
type=expr

SOURCE

[(1, "a"), (2.5, "b")]

EXPECTED

NIL

PROBLEMS

NIL

TOKENS

OpenSquare,NoSpaceOpenRound,Int,Comma,StringStart,StringPart,StringEnd,CloseRound,Comma,OpenRound,Float,Comma,StringStart,StringPart,StringEnd,CloseRound,CloseSquare,
EndOfFile,

PARSE

(e-list
	(e-tuple
		(e-int (raw "1"))
		(e-string
			(e-string-part (raw "a"))))
	(e-tuple
		(e-frac (raw "2.5"))
		(e-string
			(e-string-part (raw "b")))))

FORMATTED

NO CHANGE

CANONICALIZE

(e-list
	(elems
		(e-tuple
			(elems
				(e-num (value "1"))
				(e-string
					(e-literal (string "a")))))
		(e-tuple
			(elems
				(e-dec-small (numerator "25") (denominator-power-of-ten "1") (value "2.5"))
				(e-string
					(e-literal (string "b")))))))

TYPES

(expr (type "List((a, Str)) where [a.from_numeral : Numeral -> Try(a, [InvalidNumeral(Str)])]"))