Documentation

FT108 Intentional Failure

Back to documentation index
{
  "@context": "https://nxdlang.org/schema",
  "doc_id": "PT108",
  "title": "PT108 - Intentional Failures",
  "description": "Intentional Test Failures",
  "layer": "Passed Tests",
  "category": "Passed Tests - Nim",
  "keywords": [Nim, Pass, Test],
  "doc_version": "1.0",
  "status": "active"
}

# FT108 Intentional Failure

### NXD Sample:

```nxd
MODULE TEST

FUNC MAIN():
    LET X SET 1
    LET Y SET 2

    ECHO(X ADD Y)
```

### Result:

FAIL

### Expected Output:

FAIL - Undefined symbol

### Expected Rejection Stage:

[ ] Lexer
[ ] Parser
[ ] AST
[ ] IR
[X] Semantics
[ ] Backend

### Actual Output:

```json
{
  "module": {
    "name": "TEST",
    "imports": []
  },
  "types": [],
  "traits": [],
  "impls": [],
  "functions": [
    {
      "name": "MAIN",
      "params": [],
      "return_type": null,
      "body": [
        {
          "Let": {
            "name": "X",
            "value": {
              "Literal": {
                "Int": 1
              }
            }
          }
        },
        {
          "Let": {
            "name": "Y",
            "value": {
              "Literal": {
                "Int": 2
              }
            }
          }
        },
        {
          "Expr": {
            "Call": {
              "func": "ECHO",
              "args": [
                {
                  "Binary": {
                    "kind": "ADD",
                    "left": {
                      "Var": "X"
                    },
                    "right": {
                      "Var": "Y"
                    }
                  }
                }
              ]
            }
          }
        }
      ]
    }
  ],
  "statements": []
}
```

### Notes:

intentional Semantics failure. ECHO() is syntactically valid and parses as a function reference.
The parser accepted the construct and IR was generated successfully.
Semantic analysis attempted to resolve ECHO and failed:
UndefinedSymbol { name: "ECHO" }