Uniquness pays off

8 views
Skip to first unread message

John Skaller2

unread,
Mar 9, 2020, 1:41:06 AM3/9/20
to felix google
Wow, I just got a uniqueness error:

var extra_objects = map (fun (f:string) => f + "_dynamic" + EXT_STATIC_OBJ) control.cppobases;
if control.CXXONLY == 0 do
var result = tc . static_library_linker
(
srcs=control.cppos + extra_objects + (dvars.cpp_filebase+EXT_STATIC_OBJ) ,
dst=control.LINKER_OUTPUT_FILENAME
)
;
else
result = tc . static_library_linker
(
srcs=control.cppos,
dst=control.LINKER_OUTPUT_FILENAME
)
;
done

telling me I got an inconsistent result on path merge. I thought, oh no, this stuff again.
Another bug!

But no! The list map function is one of the few functions I updated to handle
uniqueness typing. The result of the map is a unique list.

And sure enough I LEFT OUT ADDING “extra_objects” in the second branch of
the conditional!

I should have! So the typing actually caught a real bug!!


John Skaller
ska...@internode.on.net





Raoul Duke

unread,
Mar 9, 2020, 11:58:25 AM3/9/20
to felix-l...@googlegroups.com
very nice!
Reply all
Reply to author
Forward
0 new messages