Skip to content

Commit

Permalink
Remove unnecessary variable and matching
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingun committed Sep 26, 2024
1 parent 5381aaa commit ae9ddae
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,13 @@ class ResolveTypes(specs: ClassSpecs, topClass: ClassSpec, opaqueTypes: Boolean)
}

private def resolveUserType(curClass: ClassSpec, typeName: List[String], path: List[String]): (Option[ClassSpec], Option[CompilationProblem]) = {
val res = try {
try {
val resolver = new ClassTypeProvider(specs, curClass)
Some(resolver.resolveTypePath(curClass, typeName))
val ty = resolver.resolveTypePath(curClass, typeName)
Log.typeResolve.info(() => s" => ${ty.nameAsStr}")
(Some(ty), None)
} catch {
case _: TypeNotFoundError =>
None
}

res match {
case None =>
// Type definition not found
if (opaqueTypes) {
// Generate special "opaque placeholder" ClassSpec
Expand All @@ -106,9 +103,6 @@ class ResolveTypes(specs: ClassSpecs, topClass: ClassSpec, opaqueTypes: Boolean)
Log.typeResolve.info(() => " => ??? (opaque type are disabled => error)")
(None, Some(TypeNotFoundErr(typeName, curClass, path)))
}
case Some(x) =>
Log.typeResolve.info(() => s" => ${x.nameAsStr}")
(res, None)
}
}
}

0 comments on commit ae9ddae

Please sign in to comment.