You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In javac, an ErrorType is a DeclaredType and one can get an Element out of it. Its simpleName will be the name as it was defined in the sources.
But in KSP, the KSDeclaration of a an error KSType is a synthetic declaration (specifically that KSErrorTypeClassDeclaration singleton) and its simple name is always <Error>.
This would be very helpful for reporting to the user nice traces to the missing type:
package test
import bar.MissingType;
class TestClass {
fun foo(missing: MissingType) = TODO()
}
Validation trace:
=> element (CLASS): test.TestClass
=> element (METHOD): foo(MissingType)
=> type (EXECUTABLE method): (MissingType)void
=> type (ERROR parameter type): MissingType
Note that if the type is qualified in the source, it will be similarly be reported as its 'simple name' in javac:
fun foo(missing: bar.MissingType) = TODO()
=> type (ERROR parameter type): bar.MissingType
The text was updated successfully, but these errors were encountered:
This CL makes `KSErrorType` a class with a string
"hint", that by convention should be a "simpleName"
of an unresolved type.
`KSErrorTypeClassDeclaration` is also no longer a singleton
and references a corresponding `KSErrorType`.
The implementation consists of extracting the available
info on the unresolved type on the best effort basis.
In javac, an
ErrorType
is aDeclaredType
and one can get anElement
out of it. ItssimpleName
will be the name as it was defined in the sources.But in KSP, the
KSDeclaration
of a an errorKSType
is a synthetic declaration (specifically thatKSErrorTypeClassDeclaration
singleton) and its simple name is always<Error>
.This would be very helpful for reporting to the user nice traces to the missing type:
Note that if the type is qualified in the source, it will be similarly be reported as its 'simple name' in javac:
The text was updated successfully, but these errors were encountered: