From cbf2cf2dca9022ce7967215d2aff6596d24ba603 Mon Sep 17 00:00:00 2001 From: paltherr Date: Fri, 10 Oct 2003 08:48:45 +0000 Subject: - Added methods isInstanceOf --- sources/scalac/ast/TreeGen.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sources/scalac/ast/TreeGen.java') diff --git a/sources/scalac/ast/TreeGen.java b/sources/scalac/ast/TreeGen.java index b204ef9f67..fae66b5102 100644 --- a/sources/scalac/ast/TreeGen.java +++ b/sources/scalac/ast/TreeGen.java @@ -528,6 +528,14 @@ public class TreeGen implements Kinds, Modifiers, TypeTags { //######################################################################## // Public Methods - Building expressions + /** Builds an instance test with given value and type. */ + public Tree mkIsInstanceOf(int pos, Tree value, Type type) { + return mkApplyT_(pos, Select(value, definitions.IS), new Type[]{type}); + } + public Tree mkIsInstanceOf(Tree value, Type type) { + return mkIsInstanceOf(value.pos, value, type); + } + /** Builds a cast with given value and type. */ public Tree mkAsInstanceOf(int pos, Tree value, Type type) { return mkApplyT_(pos, Select(value, definitions.AS), new Type[]{type}); -- cgit v1.2.3