Better inference error messages
parent
8b5b887b7e
commit
9e82f1f8dd
|
@ -34,14 +34,10 @@ IN: compiler.tree.builder
|
|||
if ;
|
||||
|
||||
: (build-tree-from-word) ( word -- )
|
||||
dup
|
||||
[ "inline" word-prop ]
|
||||
[ "recursive" word-prop ] bi and [
|
||||
1quotation f initial-recursive-state infer-quot
|
||||
] [
|
||||
[ specialized-def ] [ initial-recursive-state ] bi
|
||||
infer-quot
|
||||
] if ;
|
||||
dup initial-recursive-state recursive-state set
|
||||
dup [ "inline" word-prop ] [ "recursive" word-prop ] bi and
|
||||
[ 1quotation ] [ specialized-def ] if
|
||||
infer-quot-here ;
|
||||
|
||||
: check-cannot-infer ( word -- )
|
||||
dup "cannot-infer" word-prop [ cannot-infer-effect ] [ drop ] if ;
|
||||
|
|
|
@ -24,7 +24,7 @@ M: inference-error error-help error>> error-help ;
|
|||
+warning+ (inference-error) ; inline
|
||||
|
||||
M: inference-error error.
|
||||
[ "In word: " write word>> . ] [ error>> error. ] bi ;
|
||||
[ word>> [ "In word: " write . ] when* ] [ error>> error. ] bi ;
|
||||
|
||||
TUPLE: literal-expected ;
|
||||
|
||||
|
|
|
@ -4,9 +4,7 @@ USING: accessors arrays sequences kernel sequences assocs
|
|||
namespaces stack-checker.recursive-state.tree ;
|
||||
IN: stack-checker.recursive-state
|
||||
|
||||
TUPLE: recursive-state words word quotations inline-words ;
|
||||
|
||||
C: <recursive-state> recursive-state
|
||||
TUPLE: recursive-state word words quotations inline-words ;
|
||||
|
||||
: prepare-recursive-state ( word rstate -- rstate )
|
||||
swap >>word
|
||||
|
|
Loading…
Reference in New Issue