CompileErrors/A0004: Difference between revisions

From Compost Wiki
Jump to navigation Jump to search
Danielr (talk | contribs)
Created page with "{{CompileError |errortext = A0004 - Typecheck failed: <Keyword> expected <Type>, got <Token>. |description = A0004 is issued when a RHS keyword typecheck fails. One of the pa..."
 
Danielr (talk | contribs)
s/token/argument/
 
Line 1: Line 1:
{{CompileError
{{CompileError
|errortext = A0004 - Typecheck failed: <Keyword> expected <Type>, got <Token>.
|errortext = A0004 - Typecheck failed: <Keyword> expected <Type>, got <Argument>.
|description = A0004 is issued when a RHS keyword typecheck fails.  One of the parameters was expected to be a particular type (such as Number), but the provided token is not that type.
|description = A0004 is issued when a RHS keyword typecheck fails.  One of the parameters was expected to be a particular type (such as Number), but the provided argument is not that type.
|exampletext = [[Num#]] expects a literal as the first parameter.
|exampletext = [[Num#]] expects a literal as the first parameter.
|examplecode = Num#(CurrentFeed#) { A0004 - Typecheck failed: NUM# expected Literal, got "CurrentFeed#". }
|examplecode = Num#(CurrentFeed#) { A0004 - Typecheck failed: NUM# expected Literal, got "CurrentFeed#". }

Latest revision as of 22:23, 13 January 2015

A0004 - Typecheck failed: <Keyword> expected <Type>, got <Argument>.

Description

A0004 is issued when a RHS keyword typecheck fails. One of the parameters was expected to be a particular type (such as Number), but the provided argument is not that type.

Example of Cause

Num# expects a literal as the first parameter.

Num#(CurrentFeed#) { A0004 - Typecheck failed: NUM# expected Literal, got "CurrentFeed#". }

Resolution

Replace the argument with one of the correct type, or replace the keyword with one which expects the provided type.

Num#('100') { No error }