mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-23 21:33:49 +00:00
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.
27 lines
358 B
Mathematica
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.
|
|
|