Skip to content

Improve clarity of "Unsupported format" serialization error messages #3460

@Gusarich

Description

@Gusarich

Currently, serialization errors produce unclear messages like:

Error: Unsupported format 'uint8'

This is vague, as it doesn't specify the associated type, making it hard for developers to quickly identify the exact issue.

Suggested Improvement:

Change the error message to explicitly state both the unsupported serialization format and the affected type:

Error: Unsupported serialization format 'uint8' for type 'NestedData'

This change provides clear context and improves developer experience by immediately indicating the type-format mismatch.

Minimal Example to reproduce:

struct NestedData {
    x: Int;
    y: Bool;
}

contract Test {
    opt: NestedData? as uint8; // Triggers the unclear error
    init() {
        self.opt = null;
    }
}

LLM Fuzzing discovery (see #2490)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions