shithub: mc

Download patch

ref: 6d707df71c0fe11da7dd53bf36eb3d3fadb8ec9b
parent: ebeb642003c6fdbf331968cff9d2e3d769fd6b02
author: "S. Gilles" <sgilles@umd.edu>
date: Sun Dec 1 10:58:44 EST 2019

[PATCH v2 4/3] Somewhat better error for std.put("{w=?}", "foo")

diff -u a/lib/std/fmt.myr b/lib/std/fmt.myr
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -593,6 +593,10 @@
 }
 
 const pullint = {ap, msg
+	if ap.tc.nelt < 1
+		die("expected argument where none was provided")
+	;;
+
 	match typedesc(vatype(ap))
 	| `Tyint8:
 		var val : int8 = vanext(ap)
diff -u a/lib/std/fmt.myr b/lib/std/fmt.myr
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -593,6 +593,10 @@
 }
 
 const pullint = {ap, msg
+	if ap.tc.nelt < 1
+		die("expected argument where none was provided")
+	;;
+
 	match typedesc(vatype(ap))
 	| `Tyint8:
 		var val : int8 = vanext(ap)
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -593,6 +593,10 @@
 }
 
 const pullint = {ap, msg
+	if ap.tc.nelt < 1
+		die("expected argument where none was provided")
+	;;
+
 	match typedesc(vatype(ap))
 	| `Tyint8:
 		var val : int8 = vanext(ap)