Skip to content

Commit

Permalink
Seal KSNode
Browse files Browse the repository at this point in the history
KSNodeDescriptorImpl, KSNodeJavaImpl and KSNodeKtImpl were removed
because they were unused but inherited from the now sealed KSNode.
  • Loading branch information
lukellmann committed Nov 3, 2023
1 parent 82af0bb commit 431bc8f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 35 deletions.
2 changes: 1 addition & 1 deletion api/api.base
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ package com.google.devtools.ksp.symbol {
method @NonNull public String getShortName();
}

public interface KSNode {
public sealed interface KSNode {
method public <D, R> R accept(@NonNull com.google.devtools.ksp.symbol.KSVisitor<D,R> visitor, D data);
method @NonNull public com.google.devtools.ksp.symbol.Location getLocation();
method @NonNull public com.google.devtools.ksp.symbol.Origin getOrigin();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package com.google.devtools.ksp.symbol
/**
* Base class of every visitable program elements.
*/
interface KSNode {
sealed interface KSNode {
val origin: Origin
val location: Location
val parent: KSNode?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,11 @@ class ResolverImpl(
resolverContext = resolverContext
.childForClassOrPackage(resolveJavaDeclaration(e.psi) as ClassDescriptor, JavaClassImpl(e.psi))
}
is KSClassDeclaration, is KSFunctionDeclaration, is KSPropertyDeclaration, is KSTypeAlias,
is KSTypeParameter, is KSFile, is KSPropertyGetter, is KSPropertySetter, is KSTypeArgument,
is KSTypeReference, is KSValueArgument, is KSValueParameter, is KSAnnotation, is KSCallableReference,
is KSClassifierReference, is KSDefNonNullReference, is KSDynamicReference, is KSParenthesizedReference,
-> Unit
}
}
return if (javaType is JavaArrayTypeImpl)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 431bc8f

Please sign in to comment.