Sakura Lang

V1003 unresolved_type

No type, effect, variant or error tag with this name is in scope.

An error from the resolve phase. sakura explain V1003 prints this explanation offline.

No type, effect, variant or error tag with this name is in scope. Check the spelling or import it (import std/fs.{Dir}); compiler/std/INDEX.md lists what each std module exports.

Wrong:

fn shout(s: Strng) -> Int { 1 }

Fixed:

fn shout(s: String) -> Int { 1 }

Wrong program

compiler/tests/ui/V1003_unresolved_type.sakura, which the compiler's ui suite runs through sakura check:

fn shout(s: Strng) -> Int { 1 }

sakura check --json reports this record (pretty-printed; $DIR is the fixture's directory):

{
  "schema_version": "1.0",
  "kind": "diagnostic",
  "id": "d:170025eead635c7c",
  "code": "V1003",
  "severity": "error",
  "phase": "resolve",
  "message": "cannot find type `Strng` in this scope; did you mean `String`?",
  "snapshot": "sha256:$SNAPSHOT",
  "symbol_id": "main::V1003_unresolved_type::shout",
  "spans": [
    {
      "uri": "file://$DIR/V1003_unresolved_type.sakura",
      "content_hash": "sha256:3ee17b15e45f2d96e9ebdcbb1d16fd94f2048cf1f82a52c1c42069da00edcc85",
      "start_byte": 46,
      "end_byte": 51,
      "role": "primary"
    }
  ],
  "related_ids": [],
  "expected": null,
  "actual": null,
  "obligation": null,
  "counterexample": null,
  "explanation_uri": "sakura://explain/V1003",
  "fixes": [
    {
      "id": "f:170025eead635c7c.0",
      "title": "Use `String`",
      "applicability": "machine_applicable",
      "impact": "local",
      "edits": [
        {
          "span": {
            "uri": "file://$DIR/V1003_unresolved_type.sakura",
            "content_hash": "sha256:3ee17b15e45f2d96e9ebdcbb1d16fd94f2048cf1f82a52c1c42069da00edcc85",
            "start_byte": 46,
            "end_byte": 51,
            "role": "primary"
          },
          "replacement": "String"
        }
      ]
    }
  ]
}

Fixed program

compiler/tests/ui/V1003_unresolved_type.fixed.sakura, which sakura check accepts with no diagnostics:

fn shout(s: String) -> Int { 1 }
Edit on GitHub

On this page