roc/test/snapshots/expr/record_field_update.md
2025-11-09 09:39:41 -05:00

833 B

META

description=Record with field update syntax
type=expr

SOURCE

{ ..person, age: 31 }

EXPECTED

UNDEFINED VARIABLE - record_field_update.md:1:5:1:11

PROBLEMS

UNDEFINED VARIABLE Nothing is named person in this scope. Is there an import or exposing missing up-top?

record_field_update.md:1:5:1:11:

{ ..person, age: 31 }
^^^^^^

TOKENS

OpenCurly,DoubleDot,LowerIdent,Comma,LowerIdent,OpColon,Int,CloseCurly,
EndOfFile,

PARSE

(e-record
	(ext
		(e-ident (raw "person")))
	(field (field "age")
		(e-int (raw "31"))))

FORMATTED

NO CHANGE

CANONICALIZE

(e-record
	(ext
		(e-runtime-error (tag "ident_not_in_scope")))
	(fields
		(field (name "age")
			(e-num (value "31")))))

TYPES

(expr (type "Error"))