name what a member path could not type
Past a typed base, it is a field of a struct only C knows that has no type, and the warning named the base anyway: `font' for what was (. font handle), with font declared on the line before. Fixes #41.
This commit is contained in:
@@ -833,6 +833,14 @@ whitespace aside, THEN?"
|
||||
(emits? (in-line "(= (. (guess) x) 1)") "guess().x = 1"))
|
||||
(test-assert "and said so"
|
||||
(warns? (in-line "(= (. (guess) x) 1)") "cannot type this"))
|
||||
;; Past a typed base it is a field that cannot be typed -- one of a
|
||||
;; struct only C knows -- and the warning named the base regardless
|
||||
(test-assert "naming the path read so far"
|
||||
(warns? (in-fn "(var t (* struct tm) 0) (= (. t a b) 1)")
|
||||
"as a value (. t a)\n"))
|
||||
(test-assert "which one step through it does not need"
|
||||
(not (warns? (in-fn "(var t (* struct tm) 0) (= (. t a) 1)")
|
||||
"cannot type")))
|
||||
;; the arrow is `%->' and nothing else writes one, so a bare `->'
|
||||
;; is an ordinary head -- a threading macro that nobody imported,
|
||||
;; and a call like any other unknown
|
||||
|
||||
Reference in New Issue
Block a user