Skip to content

Make it possible to get information about creator functions from KotlinInvalidNullException #1026

@k163377

Description

@k163377

This issue is a discussion of features after merging of foo and after #1025.
wrt: #617 (comment)


Unlike the deprecated MissingKotlinParameterException, KotlinInvalidNullException has no information about the creator function.
This is because it was very difficult to keep reflection-related information while keeping the class as Serializable.

It is not impossible to include creator function information in a new exception, provided that the process is allowed to become very complex.

Personally, I can think of a way to keep the creator function as a string in the form of JvmSignature and restore it during processing if necessary.
A similar process has been implemented in Kogera.
This would allow the new exception to act as if it were holding a KFunction or KParameter.

However, this has the following problems

Personally, I think that there is no need for a function that reads function information directly from exceptions.
This is because the basic information is already included and humans can adequately analyze it from that information.
At least in this case, I feel that the code would be too complicated for the benefit gained.
However, if there is a very strong demand for such a function, I will consider adding it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions