summaryrefslogtreecommitdiff
path: root/sources/scalac/ast
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/ast')
-rw-r--r--sources/scalac/ast/TreeGen.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java
index 31389a3227..43d1fc1ed5 100644
--- a/sources/scalac/ast/TreeGen.java
+++ b/sources/scalac/ast/TreeGen.java
@@ -641,8 +641,10 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
/** Builds an instance test with given value and type. */
public Tree mkIsInstanceOf(int pos, Tree value, Type type) {
- Type[] targs = new Type[]{type};
- return mkApplyT_(pos, Select(value, definitions.ANY_IS), targs);
+ Symbol sym = global.currentPhase.id >= global.PHASE.TYPESASVALUES.id()
+ ? definitions.ANY_IS_ERASED
+ : definitions.ANY_IS;
+ return mkApplyT_(pos, Select(value, sym), new Type[]{type});
}
public Tree mkIsInstanceOf(Tree value, Type type) {
return mkIsInstanceOf(value.pos, value, type);
@@ -650,8 +652,10 @@ public class TreeGen implements Kinds, Modifiers, TypeTags {
/** Builds a cast with given value and type. */
public Tree mkAsInstanceOf(int pos, Tree value, Type type) {
- Type[] targs = new Type[]{type};
- return mkApplyT_(pos, Select(value, definitions.ANY_AS), targs);
+ Symbol sym = global.currentPhase.id >= global.PHASE.TYPESASVALUES.id()
+ ? definitions.ANY_AS_ERASED
+ : definitions.ANY_AS;
+ return mkApplyT_(pos, Select(value, sym), new Type[]{type});
}
public Tree mkAsInstanceOf(Tree value, Type type) {
return mkAsInstanceOf(value.pos, value, type);