roc/test/snapshots/can_nested_heterogeneous_lists.md
2025-12-03 17:10:22 -05:00

1.7 KiB

META

description=Nested heterogeneous lists
type=expr

SOURCE

[[1, "hello"], [2, 3]]

EXPECTED

MISSING METHOD - can_nested_heterogeneous_lists.md:1:3:1:4 MISSING METHOD - can_nested_heterogeneous_lists.md:1:20:1:21

PROBLEMS

MISSING METHOD This from_numeral method is being called on a value whose type doesn't have that method: can_nested_heterogeneous_lists.md:1:3:1:4:

[[1, "hello"], [2, 3]]

^

The value's type, which does not have a method named from_numeral, is:

_Str_

Hint: For this to work, the type would need to have a method named from_numeral associated with it in the type's declaration.

MISSING METHOD This from_numeral method is being called on a value whose type doesn't have that method: can_nested_heterogeneous_lists.md:1:20:1:21:

[[1, "hello"], [2, 3]]
               ^

The value's type, which does not have a method named from_numeral, is:

_Str_

Hint: For this to work, the type would need to have a method named from_numeral associated with it in the type's declaration.

TOKENS

OpenSquare,OpenSquare,Int,Comma,StringStart,StringPart,StringEnd,CloseSquare,Comma,OpenSquare,Int,Comma,Int,CloseSquare,CloseSquare,
EndOfFile,

PARSE

(e-list
	(e-list
		(e-int (raw "1"))
		(e-string
			(e-string-part (raw "hello"))))
	(e-list
		(e-int (raw "2"))
		(e-int (raw "3"))))

FORMATTED

NO CHANGE

CANONICALIZE

(e-list
	(elems
		(e-list
			(elems
				(e-num (value "1"))
				(e-string
					(e-literal (string "hello")))))
		(e-list
			(elems
				(e-num (value "2"))
				(e-num (value "3"))))))

TYPES

(expr (type "List(List(Str))"))