With a type cast, there is no information about the type.
If I have this example code
class Test { private void main() { Id test = (Id) '006D600000ZaBOeIAN'; } }
In the AST I would expect the CastExpression
to provide a clue about the type, but this is all I get:
<CastExpression DefiningType='Test' Image='' RealLoc='true'>
The full XML for the sample code is as follows.
<?xml version='1.0' encoding='UTF-8' ?> <ApexFile DefiningType='Test' Image='' RealLoc='true'> <UserClass DefiningType='Test' Image='Test' InterfaceNames='[]' Nested='false' RealLoc='true' SimpleName='Test' SuperClassName=''> <ModifierNode Abstract='false' DefiningType='Test' DeprecatedTestMethod='false' Final='false' Global='false' Image='' InheritedSharing='false' Modifiers='0' Override='false' Private='false' Protected='false' Public='false' RealLoc='false' Static='false' Test='false' TestOrTestSetup='false' Transient='false' Virtual='false' WebService='false' WithSharing='false' WithoutSharing='false' /> <Method Arity='0' CanonicalName='main' Constructor='false' DefiningType='Test' Image='main' RealLoc='true' ReturnType='void' StaticInitializer='false'> <ModifierNode Abstract='false' DefiningType='Test' DeprecatedTestMethod='false' Final='false' Global='false' Image='' InheritedSharing='false' Modifiers='2' Override='false' Private='true' Protected='false' Public='false' RealLoc='true' Static='false' Test='false' TestOrTestSetup='false' Transient='false' Virtual='false' WebService='false' WithSharing='false' WithoutSharing='false' /> <BlockStatement CurlyBrace='true' DefiningType='Test' Image='' RealLoc='true'> <VariableDeclarationStatements DefiningType='Test' Image='' RealLoc='true'> <ModifierNode Abstract='false' DefiningType='Test' DeprecatedTestMethod='false' Final='false' Global='false' Image='' InheritedSharing='false' Modifiers='0' Override='false' Private='false' Protected='false' Public='false' RealLoc='false' Static='false' Test='false' TestOrTestSetup='false' Transient='false' Virtual='false' WebService='false' WithSharing='false' WithoutSharing='false' /> <VariableDeclaration DefiningType='Test' Image='test' RealLoc='true' Type='Id'> <CastExpression DefiningType='Test' Image='' RealLoc='true'> <LiteralExpression Boolean='false' Decimal='false' DefiningType='Test' Double='false' Image='006D600000ZaBOeIAN' Integer='false' LiteralType='STRING' Long='false' Name='' Null='false' RealLoc='true' String='true' /> </CastExpression> <VariableExpression DefiningType='Test' Image='test' RealLoc='true'> <EmptyReferenceExpression DefiningType='' Image='' RealLoc='false' /> </VariableExpression> </VariableDeclaration> </VariableDeclarationStatements> </BlockStatement> </Method> </UserClass> </ApexFile>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4