From c4bed34b009ffc54b1eac10ee75fba27040f1533 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 13 Feb 2014 14:50:04 +0100 Subject: Two performance optimizations 1) Split out wildApprox into separate function 2) Be more careful not to follow static prefix chains where not needed --- src/dotty/tools/dotc/typer/Namer.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index fac08ea3d..96fa7f44f 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -551,7 +551,7 @@ class Namer { typer: Typer => defContext(sym).denotNamed(original) def paramProto(paramss: List[List[Type]], idx: Int): Type = paramss match { case params :: paramss1 => - if (idx < params.length) (new WildApprox) apply params(idx) + if (idx < params.length) wildApprox(params(idx)) else paramProto(paramss1, idx - params.length) case nil => WildcardType -- cgit v1.2.3