Closed samth closed 4 hours ago
This program:
#lang rhombus fun run1(inp :: String): print((inp.split("\n")).map(fun (k :: String): (k.split()))) run1("x y\na b\n")
produces the error:
PairList.map: value does not satisfy annotation value: ["x y", "a b"] annotation: PairList Context (plain): /home/samth/sw/plt/extra-pkgs/rhombus-prototype/rhombus-lib/rhombus/private/define-arity.rkt:94:11 PairList.map day1.rhm:6:0 run1 /home/samth/sw/racket-mode/racket/repl.rkt:323:0 configure/require/enter
Annotating the inp.split("\n") expression as a List fixes the error.
inp.split("\n")
List
The problem is that String.split has PairList for its declared result instead of List. I'll fix it.
String.split
PairList
This program:
produces the error:
Annotating the
inp.split("\n")
expression as aList
fixes the error.