summaryrefslogtreecommitdiff
path: root/sources/scalac/ast
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-05-30 08:18:28 +0000
committermihaylov <mihaylov@epfl.ch>2005-05-30 08:18:28 +0000
commitd7268ca89a37d537fe59d4ec1b0a8474429b4d25 (patch)
tree8d61ff645691745642b3faf0f8cf5fd73e669426 /sources/scalac/ast
parent2fa90340ddf2238e04429f2fe7e8a4d2ddc2a12c (diff)
downloadscala-d7268ca89a37d537fe59d4ec1b0a8474429b4d25.tar.gz
scala-d7268ca89a37d537fe59d4ec1b0a8474429b4d25.tar.bz2
scala-d7268ca89a37d537fe59d4ec1b0a8474429b4d25.zip
In mkDefaultValue first check for a value type ...
In mkDefaultValue first check for a value type and only then for reference type; fixes the problem with the default value when value types implement interfaces and are therefore considered reference types
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r--sources/scalac/ast/TreeGen.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java
index e6b98f0f42..d8f61d27de 100644
--- a/sources/scalac/ast/TreeGen.java
+++ b/sources/scalac/ast/TreeGen.java
@@ -173,10 +173,10 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
/** Builds a default zero value according to given type. */
public Tree mkDefaultValue(int pos, Type type) {
- if (definitions.ALLREF_TYPE().isSubType(type)) return mkNullLit(pos);
switch (type.unbox()) {
case UnboxedType(int tag): return mkDefaultValue(pos, tag);
}
+ if (definitions.ALLREF_TYPE().isSubType(type)) return mkNullLit(pos);
return mkZeroLit(pos);
}