Skip to content

Commit ad4282f

Browse files
committed
Call MethodTypeCompanion.check valid on Java method types
1 parent abbb62e commit ad4282f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,10 +2784,8 @@ object Types {
27842784
tl => tl.integrate(params, resultType))
27852785
}
27862786

2787-
final def apply(paramNames: List[TermName])(paramInfosExp: MethodType => List[Type], resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType = {
2788-
val mtc = unique(new CachedMethodType(paramNames)(paramInfosExp, resultTypeExp, kind))
2789-
if (kind is JavaKind) mtc else checkValid(mtc)
2790-
}
2787+
final def apply(paramNames: List[TermName])(paramInfosExp: MethodType => List[Type], resultTypeExp: MethodType => Type)(implicit ctx: Context): MethodType =
2788+
checkValid(new CachedMethodType(paramNames)(paramInfosExp, resultTypeExp, kind))
27912789

27922790
def checkValid(mt: MethodType)(implicit ctx: Context): mt.type = {
27932791
if (Config.checkMethodTypes)

0 commit comments

Comments
 (0)