Skip to content

Improve type checking errors with structs#761

Merged
lgritz merged 1 commit intoAcademySoftwareFoundation:masterfrom
lgritz:lg-structerr
Jun 1, 2017
Merged

Improve type checking errors with structs#761
lgritz merged 1 commit intoAcademySoftwareFoundation:masterfrom
lgritz:lg-structerr

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented Jun 1, 2017

Change the implementation of TypeSpec::string(), which returns the text
representation of a TypeSpec, so that it prints the name of the struct
rather than just its numerical designation.

An example of the old behavior, as applied to a type checking error
message:

test.osl:10: error: No matching function call to 'max (struct 1, struct 1)'
...

And the new behavior:

test.osl:10: error: No matching function call to 'max (struct vector4, struct vector4)'
...

Change the implementation of TypeSpec::string(), which returns the text
representation of a TypeSpec, so that it prints the name of the struct
rather than just its numerical designation.

An example of the old behavior, as applied to a type checking error
message:

    test.osl:10: error: No matching function call to 'max (struct 1, struct 1)'
        Candidates are:
            int max (int, int)
            float max (float, float)
            ...

And the new behavior:

    test.osl:10: error: No matching function call to 'max (struct vector4, struct vector4)'
@fpsunflower
Copy link
Copy Markdown
Contributor

LGTM!

@lgritz lgritz merged commit 3f6a926 into AcademySoftwareFoundation:master Jun 1, 2017
@lgritz lgritz deleted the lg-structerr branch June 1, 2017 21:50
lgritz added a commit to lgritz/OpenShadingLanguage that referenced this pull request Oct 24, 2017
)

Change the implementation of TypeSpec::string(), which returns the text
representation of a TypeSpec, so that it prints the name of the struct
rather than just its numerical designation.

An example of the old behavior, as applied to a type checking error
message:

    test.osl:10: error: No matching function call to 'max (struct 1, struct 1)'
        Candidates are:
            int max (int, int)
            float max (float, float)
            ...

And the new behavior:

    test.osl:10: error: No matching function call to 'max (struct vector4, struct vector4)'
lgritz added a commit that referenced this pull request Oct 25, 2017
Change the implementation of TypeSpec::string(), which returns the text
representation of a TypeSpec, so that it prints the name of the struct
rather than just its numerical designation.

An example of the old behavior, as applied to a type checking error
message:

    test.osl:10: error: No matching function call to 'max (struct 1, struct 1)'
        Candidates are:
            int max (int, int)
            float max (float, float)
            ...

And the new behavior:

    test.osl:10: error: No matching function call to 'max (struct vector4, struct vector4)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants