package yokohama.unit.ast;

import yokohama.unit.position.Span;
import lombok.EqualsAndHashCode;
import lombok.Value;
import yokohama.unit.util.ClassResolver;

@Value
@EqualsAndHashCode(exclude={"span"})
public class ClassType implements NonArrayType {
    private String name;
    private Span span;

    public String getCanonicalName(ClassResolver classResolver) {
        try {
            return classResolver.lookup(name).getCanonicalName();
        } catch (ClassNotFoundException e) {
            throw new AstException(e.getMessage(), span, e);
        }
    }

    @Override
    public <T> T accept(NonArrayTypeVisitor<T> visitor) {
        return visitor.visitClassType(this);
    }
}

@@ -304,24 +304,275 @@
 an span;%0D%0A%0D%0A
+    public Class%3C?%3E toClass(ClassResolver classResolver) %7B%0D%0A        try %7B%0D%0A            return classResolver.lookup(name);%0D%0A        %7D catch (ClassNotFoundException e) %7B%0D%0A            throw new AstException(e.getMessage(), span, e);%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A
     public S

Add toClass method