Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type and enum leaking from one imported KSY to another #303

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make all internal methods of ResolveTypes pass private
  • Loading branch information
Mingun committed Oct 4, 2024
commit 64d770b241b27f184cd0caaeadb9c3c6833d6668
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ResolveTypes(specs: ClassSpecs, topClass: ClassSpec, opaqueTypes: Boolean)
* ClassSpec.
* @param curClass class to start from, might be top-level class
*/
def resolveUserTypes(curClass: ClassSpec): Iterable[CompilationProblem] = {
private def resolveUserTypes(curClass: ClassSpec): Iterable[CompilationProblem] = {
val seqProblems: Iterable[CompilationProblem] =
curClass.seq.flatMap((attr) => resolveUserTypeForMember(curClass, attr))

Expand All @@ -40,10 +40,10 @@ class ResolveTypes(specs: ClassSpecs, topClass: ClassSpec, opaqueTypes: Boolean)
seqProblems ++ instancesProblems ++ paramsProblems
}

def resolveUserTypeForMember(curClass: ClassSpec, attr: MemberSpec): Iterable[CompilationProblem] =
private def resolveUserTypeForMember(curClass: ClassSpec, attr: MemberSpec): Iterable[CompilationProblem] =
resolveUserType(curClass, attr.dataType, attr.path)

def resolveUserType(curClass: ClassSpec, dataType: DataType, path: List[String]): Iterable[CompilationProblem] = {
private def resolveUserType(curClass: ClassSpec, dataType: DataType, path: List[String]): Iterable[CompilationProblem] = {
dataType match {
case ut: UserType =>
val (resClassSpec, problems) = resolveUserType(curClass, ut.name, path ++ List("type"))
Expand All @@ -68,7 +68,7 @@ class ResolveTypes(specs: ClassSpecs, topClass: ClassSpec, opaqueTypes: Boolean)
}
}

def resolveUserType(curClass: ClassSpec, typeName: List[String], path: List[String]): (Option[ClassSpec], Option[CompilationProblem]) = {
private def resolveUserType(curClass: ClassSpec, typeName: List[String], path: List[String]): (Option[ClassSpec], Option[CompilationProblem]) = {
val res = realResolveUserType(curClass, typeName, path)

res match {
Expand Down Expand Up @@ -136,7 +136,7 @@ class ResolveTypes(specs: ClassSpecs, topClass: ClassSpec, opaqueTypes: Boolean)
}
}

def resolveEnumSpec(curClass: ClassSpec, typeName: List[String]): Option[EnumSpec] = {
private def resolveEnumSpec(curClass: ClassSpec, typeName: List[String]): Option[EnumSpec] = {
Log.enumResolve.info(() => s"resolveEnumSpec: at ${curClass.name} doing ${typeName.mkString("|")}")

val res = realResolveEnumSpec(curClass, typeName)
Expand Down