From 50a55f177478f532ffc50277d993ec86df516428 Mon Sep 17 00:00:00 2001 From: Julian Hyde Date: Wed, 13 Apr 2022 08:12:38 -0700 Subject: [PATCH] fix up test; logged https://github.com/hydromatic/morel/issues/139 --- src/test/resources/script/suchThat.sml | 2 +- src/test/resources/script/suchThat.sml.out | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/test/resources/script/suchThat.sml b/src/test/resources/script/suchThat.sml index 12dad4a9..4575a7cf 100644 --- a/src/test/resources/script/suchThat.sml +++ b/src/test/resources/script/suchThat.sml @@ -63,7 +63,7 @@ in end; (*) A function with external extent. -fun hasJob e job = +fun hasJob (e: {name: string, job: string, empno: int}) job = e.job = job; (*) Valid, because the argument has an extent. let diff --git a/src/test/resources/script/suchThat.sml.out b/src/test/resources/script/suchThat.sml.out index 103569d5..26324f61 100644 --- a/src/test/resources/script/suchThat.sml.out +++ b/src/test/resources/script/suchThat.sml.out @@ -73,9 +73,9 @@ val it = [] : string list (*) A function with external extent. -fun hasJob e job = +fun hasJob (e: {name: string, job: string, empno: int}) job = e.job = job; -java.lang.ClassCastException: class net.hydromatic.morel.type.TypeVar cannot be cast to class net.hydromatic.morel.type.RecordLikeType (net.hydromatic.morel.type.TypeVar and net.hydromatic.morel.type.RecordLikeType are in unnamed module of loader 'app') +val hasJob = fn : {empno:int, job:string, name:string} -> string -> bool (*) Valid, because the argument has an extent. let @@ -90,8 +90,7 @@ val it = [] : string list (*) Invalid, because the argument has no extent. from e suchThat hasJob e "CLERK"; -stdIn:2.17-2.23 Error: unbound variable or constructor: hasJob - raised at: stdIn:2.17-2.23 +val it = [] : {empno:int, job:string, name:string} list (*) A string function with external extent.