Files
mercury/tests/valid/record_syntax_bug_4.m
Simon Taylor 1c89d4066e Fix a bug in record syntax.
Estimated hours taken: 1
Branches: main, release

Fix a bug in record syntax.

compiler/post_typecheck.m:
	Check for higher-order terms before field access functions
	when resolving a var-functor unification, because it's easier
	to check that the argument types of a higher-order term match.

compiler/hlds_module.m:
	Export get_proc_id for use by post_typecheck.m.

tests/valid/Mmakefile:
tests/valid/record_syntax_bug_4.m:
	Test case.
2001-09-05 09:10:12 +00:00

27 lines
358 B
Mathematica

:- module record_syntax_bug_4.
:- interface.
:- import_module io.
:- pred main(io__state::di, io__state::uo) is det.
:- implementation.
:- import_module list.
:- type info
---> info(
field :: int
).
main -->
{ List = list__map(field(info(1)), [1, 2, 3]) },
io__write(List),
io__nl.
:- func field(info, int) = int.
field(_Info, Int) = Int.