#include "WfAnalyzer.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
reflection
;
using
namespace
reflection
::
description
;
using
namespace
typeimpl
;
class
ExpandVirtualExpressionVisitor
:
public
,
public
::
{
public
:
*
;
<
>
;
ExpandVirtualExpressionVisitor
(
*
,
<
>
)
:manager(
)
, expectedType(
)
{
}
void
(
*
)
override
{
(
,
);
}
void
(
*
)
override
{
ExpandNewCoroutineExpression
(
,
);
}
void
(
*
)
override
{
ExpandMixinCastExpression
(
,
);
}
void
(
WfExpectedTypeCastExpression
*
)
override
{
auto
=
<
>();
castExpr
=
->
;
castExpr
(
->
,
true
);
castExpr
(
.
());
->
castExpr
;
}
void
(
*
)
override
{
auto
=
->
].
();
auto
=
scope
->
();
if
(
functionScope
->
.
<
>())
{
ExpandCoOperatorExpression
(
,
);
}
}
};
class
ValidateSemanticExpressionVisitor
:
public
,
public
::
,
public
::
{
public
:
*
;
<
>
;
<
>&
;
ValidateSemanticExpressionVisitor
(
*
,
<
>
,
<
>&
)
:manager(
)
, expectedType(
)
, results(
)
{
}
void
(
*
)
override
{
auto
=
->
].
();
<
>
;
while
(
scope
)
{
if
(
auto
=
scope
->
)
{
lastConfig
config
;
if
(!
lastConfig
)
{
break
;
}
}
if
(
scope
->
)
{
if
(!
lastConfig
)
{
break
;
}
if
(
lastConfig
)
{
auto
=
<
>(
scope
->
,
::
);
auto
=
<
>(
elementType
);
.
(
::
(
pointerType
));
return
;
}
}
scope
=
scope
->
.
();
}
->
.
(
::
(
));
}
void
(
*
)
override
{
if
(
->
)
{
=
->
.
().
(
->
.
);
if
(
index
!= -
1
)
{
.
(
::
(
->
.
()
index
]));
return
;
}
}
->
.
(
::
TopQualifiedSymbolNotExists
(
,
->
.
));
}
void
(
*
,
const
&
)
{
auto
=
->
].
();
<
>
;
->
(
scope
,
,
nameResults
);
for
(
=
0
;
i
<
nameResults
.
();
i
++)
{
auto
&
=
nameResults
i
];
if
(
result
.
)
{
if
(!
result
.
)
{
->
.
(
::
ExpressionCannotResolveType
(
,
result
.
));
}
else
if
(!
result
.
.
<
>() ||
result
.
.
<
>())
{
bool
=
false
;
if
(!
result
.
->
.
<
>() && !
result
.
->
.
<
>())
{
auto
=
scope
;
*
=
nullptr
;
*
=
nullptr
;
while
(
currentScope
)
{
if
(
currentScope
->
)
{
if
(!
firstConfigScope
)
{
firstConfigScope
=
currentScope
;
}
lastConfigScope
=
currentScope
;
}
if
(
result
.
==
currentScope
)
{
if
(
firstConfigScope
&&
firstConfigScope
->
)
{
readonlyCaptured
=
true
;
}
if
(
currentScope
->
.
<
>())
{
if
(
firstConfigScope
)
{
readonlyCaptured
=
firstConfigScope
!=
lastConfigScope
;
if
(!
lastConfigScope
->
())
{
->
.
(
::
FieldCannotInitializeUsingEachOther
(
,
result
));
}
}
else
{
->
.
(
::
FieldCannotInitializeUsingEachOther
(
,
result
));
}
}
break
;
}
if
(
currentScope
->
.
<
>())
{
auto
=
->
currentScope
->
.
()];
if
(!
capture
.
(
result
.
.
()))
{
if
(
lastConfigScope
==
nullptr
)
{
capture
.
(
result
.
);
}
else
{
auto
=
->
lastConfigScope
->
.
()];
if
(
capture
functionCapture
)
{
capture
.
(
result
.
);
}
}
}
}
if
(
currentScope
->
)
{
if
(
currentScope
->
)
{
auto
=
->
currentScope
->
.
()];
if
(!
capture
.
(
result
.
.
()))
{
capture
.
(
result
.
);
}
}
}
currentScope
=
currentScope
->
.
();
}
}
if
(
readonlyCaptured
)
{
.
(
::
(
result
.
));
}
else
{
.
(
::
(
result
.
));
}
}
else
{
.
(
result
);
}
}
else
{
if
(
result
.
&&
dynamic_cast
<
*>(
))
{
auto
=
scope
;
*
=
nullptr
;
*
=
nullptr
;
while
(
currentScope
)
{
if
(
currentScope
->
)
{
if
(!
firstConfigScope
)
{
firstConfigScope
=
currentScope
;
}
lastConfigScope
=
currentScope
;
}
if
(
currentScope
->
.
<
>() &&
currentScope
->
==
result
.
->
())
{
if
(
firstConfigScope
)
{
bool
=
lastConfigScope
->
() &&
lastConfigScope
->
.
<
>();
bool
=
lastConfigScope
->
.
<
>();
bool
=
lastConfigScope
->
.
<
>();
bool
=
lastConfigScope
->
.
<
>();
if
(!
inMethodBody
&& !
inDtorBody
&& !
inCtorBody
&& !
inStateBody
)
{
->
.
(
::
FieldCannotInitializeUsingEachOther
(
,
result
));
}
}
else
if
(!
scope
->
.
<
>())
{
->
.
(
::
FieldCannotInitializeUsingEachOther
(
,
result
));
}
}
currentScope
=
currentScope
->
.
();
}
}
.
(
result
);
}
}
if
(
.
() ==
0
)
{
if
(
nameResults
.
() >
0
)
{
FOREACH(ResolveExpressionResult, result, nameResults)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
nameResults
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
result
);)
{
->
.
(
::
ExpressionCannotResolveType
(
,
result
.
));
}
}
else
{
->
.
(
::
(
,
));
}
}
}
void
(
*
)
override
{
if
(
&& (
()->
()
::
) !=
::
)
{
auto
=
->
].
();
<
>
;
->
(
scope
,
->
.
,
testResults
);
if
(
testResults
.
() ==
0
)
{
auto
=
()->
();
if
(
enumType
->
(
->
.
) == -
1
)
{
->
.
(
::
(
,
(),
->
.
));
}
else
{
.
(
::
(
));
}
return
;
}
}
(
,
->
.
);
FOREACH(ResolveExpressionResult, result, results)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
result
);)
{
*
=
nullptr
;
if
(
result
.
)
{
td
=
result
.
->
();
}
else
if
(
result
.
)
{
td
=
result
.
->
();
}
else
if
(
result
.
)
{
td
=
result
.
->
();
}
if
(
td
)
{
auto
=
->
].
();
bool
=
false
;
while
(
scope
)
{
if
(
scope
->
)
{
visibleToNonStatic
=
scope
->
||
scope
->
;
}
if
(
scope
->
&&
scope
->
->
(
td
))
{
if
(!
visibleToNonStatic
)
{
if
(
result
.
)
{
if
(!
result
.
->
())
{
->
.
(
::
CannotCallMemberInStaticFunction
(
,
result
));
}
}
else
if
(
result
.
)
{
->
.
(
::
CannotCallMemberInStaticFunction
(
,
result
));
}
else
if
(
result
.
)
{
->
.
(
::
CannotCallMemberInStaticFunction
(
,
result
));
}
break
;
}
}
scope
=
scope
->
.
();
}
}
}
}
void
(
*
)
override
{
(
,
->
.
);
}
void
(
WfOrderedLambdaExpression
*
)
override
{
auto
=
->
].
();
<
<
>>
;
(
parameterSymbols
,
<
>(
0
,
scope
->
.
())
.
([scope](
)->
<
>{
return
scope
->
.
(
index
)
0
];})
.
([](
<
>
,
<
>
)
{
=
(
a
.
(
1
,
a
.
() -
1
));
=
(
b
.
(
1
,
a
.
() -
1
));
return
aId
-
bId
;
})
);
<
>
=
;
if
(!
&&
parameterSymbols
.
() >
0
)
{
->
.
(
::
OrderedLambdaCannotResolveType
(
));
return
;
}
else
if
(
)
{
*
=
.
();
if
(
type
->
() !=
::
)
{
goto
ORDERED_FAILED;
}
type
=
type
->
();
if
(
type
->
() !=
::
)
{
goto
ORDERED_FAILED;
}
{
*
=
type
->
();
if
(
functionType
->
() !=
::
)
{
goto
ORDERED_FAILED;
}
if
(
functionType
->
() !=
description
::
<
>())
{
goto
ORDERED_FAILED;
}
}
if
(
type
->
() !=
parameterSymbols
.
() +
1
)
{
goto
ORDERED_FAILED;
}
<
>
=
type
->
(
0
);
FOREACH_INDEXER(Ptr<WfLexicalSymbol>, symbol, index, parameterSymbols)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
parameterSymbols
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
symbol
);
index
++)
{
symbol
type
->
(
index
+
1
);
symbol
(
symbol
.
());
}
(
,
->
,
resultType
);
}
else
{
auto
=
(
,
->
,
0
);
if
(
bodyType
)
{
auto
=
<
>(
description
::
<
>(),
::
);
auto
=
<
>(
funcType
);
genericType
(
bodyType
);
resultType
<
>(
genericType
);
}
}
goto
ORDERED_FINISHED;
ORDERED_FAILED:
->
.
(
::
OrderedLambdaCannotImplicitlyConvertToType
(
,
.
()));
ORDERED_FINISHED:
if
(
resultType
)
{
.
(
::
(
resultType
));
}
}
void
(
*
)
override
{
<
>
=
(
,
->
,
0
);
if
(
type
)
{
<
*>
;
->
(
type
(),
->
.
,
false
,
searchedTypes
,
);
if
(
.
() ==
0
)
{
->
.
(
::
(
,
type
(),
->
.
));
}
}
}
void
(
*
)
override
{
if
(
<
>
=
(
,
->
))
{
=
scopeName
.
().
(
->
.
);
if
(
index
!= -
1
)
{
.
(
::
(
scopeName
.
()
index
]));
return
;
}
if
(
scopeName
)
{
<
*>
;
->
(
scopeName
,
->
.
,
true
,
searchedTypes
,
);
if
(
.
() >
0
)
{
FOREACH(ResolveExpressionResult, result, results)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
result
);)
{
if
(
result
.
)
{
if
(!
result
.
->
())
{
->
.
(
::
CannotCallMemberOutsideOfClass
(
,
result
));
}
}
else
if
(
result
.
)
{
->
.
(
::
CannotCallMemberOutsideOfClass
(
,
result
));
}
else
if
(
result
.
)
{
->
.
(
::
CannotCallMemberOutsideOfClass
(
,
result
));
}
}
return
;
}
}
if
(
scopeName
!=
nullptr
&& (
scopeName
->
()
::
) !=
::
)
{
->
.
(
::
(
,
scopeName
,
->
.
));
}
else
{
->
.
(
::
(
,
scopeName
,
->
.
));
}
}
}
void
(
*
)
override
{
if
(
->
==
::
)
{
if
(!
)
{
->
.
(
::
(
));
}
else
if
(!
(
.
()))
{
->
.
(
::
NullCannotImplicitlyConvertToType
(
,
.
()));
}
.
(
::
(
));
}
else
{
.
(
::
(
<
bool
>::
()));
}
}
void
(
*
)
override
{
auto
=
?
() :
nullptr
;
if
(!
typeDescriptor
||
typeDescriptor
->
() ==
::
||
typeDescriptor
==
description
::
<
>())
{
typeDescriptor
=
description
::
<
double
>();
}
if
(
auto
=
typeDescriptor
->
())
{
;
if
(
serializableType
->
(
->
.
,
output
))
{
.
(
::
(
<
>(
typeDescriptor
,
::
)));
return
;
}
}
->
.
(
::
FloatingLiteralOutOfRange
(
));
}
void
(
*
)
override
{
auto
=
?
() :
nullptr
;
if
(!
typeDescriptor
||
typeDescriptor
->
() ==
::
||
typeDescriptor
==
description
::
<
>())
{
#ifdef VCZH_64
typeDescriptor = description::GetTypeDescriptor<vint64_t>();
#else
typeDescriptor
=
description
::
<
>();
#endif
}
if
(
auto
=
typeDescriptor
->
())
{
;
if
(
serializableType
->
(
->
.
,
output
))
{
.
(
::
(
<
>(
typeDescriptor
,
::
)));
return
;
}
}
->
.
(
::
(
));
}
void
(
*
)
override
{
.
(
::
(
<
>::
()));
}
void
(
*
)
override
{
<
>
=
(
,
->
,
0
);
if
(
typeInfo
)
{
=
(
typeInfo
.
());
switch
(
->
)
{
case
::
:
switch
(
flag
)
{
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
->
.
(
::
(
,
typeInfo
.
()));
break
;
default
:;
}
break
;
case
::
:
switch
(
flag
)
{
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
->
.
(
::
(
,
typeInfo
.
()));
break
;
default
:;
}
break
;
case
::
:
switch
(
flag
)
{
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
->
.
(
::
(
,
typeInfo
.
()));
break
;
default
:;
}
break
;
}
.
(
::
(
typeInfo
));
}
}
void
(
*
)
override
{
if
(
->
==
::
)
{
<
>
=
GetLeftValueExpressionType
(
,
->
);
(
,
->
,
variableType
);
if
(
variableType
)
{
.
(
::
(
variableType
));
}
}
else
if
(
->
==
::
)
{
<
>
=
(
,
->
,
0
);
if
(
containerType
)
{
if
(
containerType
() ==
::
)
{
*
=
containerType
();
<
>
;
<
>
;
bool
=
false
;
if
(
genericType
->
() ==
::
)
{
*
=
genericType
->
();
if
(
classType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
(
genericType
->
(
0
));
}
else
if
(
classType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
(
genericType
->
(
0
));
leftValue
=
true
;
}
else
if
(
classType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
(
genericType
->
(
0
));
leftValue
=
true
;
}
else
if
(
classType
->
() ==
description
::
<
>())
{
indexType
(
genericType
->
(
0
));
resultType
(
genericType
->
(
1
));
}
else
if
(
classType
->
() ==
description
::
<
>())
{
indexType
(
genericType
->
(
0
));
resultType
(
genericType
->
(
1
));
leftValue
=
true
;
}
else
{
->
.
(
::
(
,
containerType
.
()));
}
}
else
{
if
(
genericType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
<
>::
();
}
else
if
(
genericType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
<
>::
();
leftValue
=
true
;
}
else
if
(
genericType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
<
>::
();
leftValue
=
true
;
}
else
if
(
genericType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
<
>::
();
}
else
if
(
genericType
->
() ==
description
::
<
>())
{
indexType
<
>::
();
resultType
<
>::
();
leftValue
=
true
;
}
else
{
->
.
(
::
(
,
containerType
.
()));
}
}
(
,
->
,
indexType
);
if
(
resultType
)
{
if
(
leftValue
)
{
.
(
::
(
resultType
));
}
else
{
.
(
::
(
resultType
));
}
}
}
else
{
->
.
(
::
(
,
containerType
.
()));
}
}
}
else
if
(
->
==
::
)
{
auto
=
(
,
->
,
);
auto
=
(
,
->
,
);
if
(
typeA
&&
typeB
)
{
if
(
typeA
() ==
::
&&
typeB
() ==
::
)
{
auto
=
<
>::
();
if
(
(
typeA
.
(),
stringType
.
(),
false
) &&
(
typeB
.
(),
stringType
.
(),
false
))
{
.
(
::
(
stringType
));
return
;
}
else
if
(
auto
=
(
typeA
,
typeB
))
{
if
(
type
()->
() !=
::
)
{
->
.
(
::
(
->
.
(),
type
.
()));
}
.
(
::
(
type
));
return
;
}
}
->
.
(
::
(
,
typeA
.
(),
typeB
.
()));
}
}
else
if
(
->
==
::
)
{
auto
=
(
,
->
,
);
auto
=
(
,
->
,
);
if
(
typeA
&&
typeB
)
{
if
(
typeA
() ==
::
&&
typeB
() ==
::
)
{
if
(
auto
=
(
typeA
,
typeB
))
{
if
(
type
()->
() !=
::
)
{
->
.
(
::
IncorrectTypeForIntersect
(
->
.
(),
type
.
()));
}
.
(
::
(
type
));
return
;
}
}
->
.
(
::
(
,
typeA
.
(),
typeB
.
()));
}
}
else
if
(
->
==
::
)
{
<
>
=
(
,
->
,
0
);
bool
=
IsExpressionDependOnExpectedType
(
,
->
);
<
>
=
(
,
->
, (
depend
?
firstType
:
nullptr
));
if
(
firstType
&&
secondType
)
{
if
(
auto
=
(
firstType
,
secondType
))
{
.
(
::
(
mergedType
));
}
else
{
->
.
(
::
(
,
firstType
.
(),
secondType
.
()));
}
}
}
else
{
<
>
=
(
,
->
,
0
);
<
>
=
(
,
->
,
0
);
<
>
;
if
(
firstType
&&
secondType
)
{
if
(!(
elementType
(
firstType
,
secondType
)))
{
->
.
(
::
(
,
firstType
.
(),
secondType
.
()));
}
}
if
(
elementType
)
{
=
(
elementType
.
());
*
=
0
;
switch
(
->
)
{
case
::
:
{
static
[(
)
::
] = {
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
};
selectedTable
=
conversionTable
;
}
break
;
case
::
:
case
::
:
case
::
:
case
::
:
{
static
[(
)
::
] = {
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
};
selectedTable
=
conversionTable
;
}
break
;
case
::
:
case
::
:
case
::
:
{
static
[(
)
::
] = {
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
};
selectedTable
=
conversionTable
;
}
break
;
case
::
:
case
::
:
case
::
:
case
::
:
{
static
[(
)
::
] = {
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
};
selectedTable
=
conversionTable
;
}
break
;
case
::
:
case
::
:
{
.
(
::
(
<
bool
>::
()));
return
;
}
break
;
case
::
:
case
::
:
case
::
:
{
static
[(
)
::
] = {
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
::
,
};
selectedTable
=
conversionTable
;
}
break
;
default
:;
}
=
selectedTable
[(
)
flag
];
if
(
resultFlag
==
::
)
{
->
.
(
::
BinaryOperatorOnWrongType
(
,
elementType
.
()));
}
else
{
.
(
::
(
CreateTypeInfoFromTypeFlag
(
resultFlag
)));
}
}
}
}
void
(
*
)
override
{
auto
=
->
].
();
FOREACH(Ptr<WfLetVariable>, variable, node->variables)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
variable
);)
{
auto
=
scope
->
variable
.
]
0
];
symbol
(
,
variable
,
0
);
if
(
symbol
)
{
symbol
(
symbol
.
());
}
}
<
>
=
(
,
->
,
);
if
(
type
)
{
.
(
::
(
type
));
}
}
void
(
*
)
override
{
<
>
=
<
bool
>::
();
(
,
->
,
boolType
);
<
>
,
;
if
(
)
{
firstType
(
,
->
,
);
secondType
(
,
->
,
);
}
else
{
bool
= !
IsExpressionDependOnExpectedType
(
,
->
);
bool
= !
IsExpressionDependOnExpectedType
(
,
->
);
if
(
resolveFirst
==
resolveSecond
)
{
firstType
(
,
->
,
0
);
secondType
(
,
->
,
0
);
}
else
if
(
resolveFirst
)
{
firstType
(
,
->
,
0
);
secondType
(
,
->
,
firstType
);
}
else
if
(
resolveSecond
)
{
secondType
(
,
->
,
0
);
firstType
(
,
->
,
secondType
);
}
}
if
(
firstType
&& !
secondType
)
{
.
(
::
(
firstType
));
}
else
if
(!
firstType
&&
secondType
)
{
.
(
::
(
secondType
));
}
else
if
(
firstType
&&
secondType
)
{
if
(
auto
=
(
firstType
,
secondType
))
{
.
(
::
(
mergedType
));
}
else
{
->
.
(
::
(
,
firstType
.
(),
secondType
.
()));
}
}
}
void
(
*
)
override
{
<
>
=
(
,
->
,
0
);
<
>
=
(
,
->
,
0
);
<
>
;
if
(
firstType
&& !
secondType
)
{
elementType
firstType
;
}
else
if
(!
firstType
&&
secondType
)
{
elementType
secondType
;
}
else
if
(
firstType
&&
secondType
)
{
if
(!(
elementType
(
firstType
,
secondType
)))
{
->
.
(
::
(
,
firstType
.
(),
secondType
.
()));
}
}
if
(
elementType
)
{
=
(
elementType
.
());
switch
(
flag
)
{
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
case
::
:
break
;
default
:
->
.
(
::
(
,
elementType
.
()));
}
auto
=
<
>(
description
::
<
>(),
::
);
auto
=
<
>(
enumerableType
);
genericType
(
elementType
);
auto
=
<
>(
genericType
);
.
(
::
(
pointerType
));
}
}
void
(
*
)
override
{
<
>
=
(
,
->
,
0
);
if
(
auto
=
->
.
<
>())
{
<
>
=
(
,
range
,
0
);
<
>
=
(
,
range
,
0
);
if
(
elementType
&&
beginType
)
{
if
(!
(
elementType
,
beginType
))
{
->
.
(
::
(
,
elementType
.
(),
beginType
.
()));
}
}
if
(
elementType
&&
endType
)
{
if
(!
(
elementType
,
endType
))
{
->
.
(
::
(
,
elementType
.
(),
endType
.
()));
}
}
}
else
{
<
>
=
GetEnumerableExpressionItemType
(
,
->
,
0
);
if
(
elementType
&&
itemType
)
{
if
(!
(
elementType
,
itemType
))
{
->
.
(
::
(
,
elementType
.
(),
itemType
.
()));
}
}
}
.
(
::
(
<
bool
>::
()));
}
void
(
*
)
override
{
if
(
&&
()->
() ==
::
)
{
<
>
;
FOREACH(Ptr<WfConstructorArgument>, argument, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
if
(!
argument
)
{
->
.
(
::
ConstructorMixStructAndList
(
));
return
;
}
else
if
(
auto
=
argument
.
<
>())
{
if
(
auto
=
()->
(
field
.
,
true
))
{
if
(
fields
.
(
field
.
))
{
->
.
(
::
DuplicatedConstructorField
(
field
.
()));
}
else
{
fields
.
(
field
.
);
}
(
,
argument
,
(
prop
->
()));
}
else
{
->
.
(
::
(
field
.
(),
(),
field
.
));
}
}
else
{
->
.
(
::
ConstructorMixStructAndList
(
argument
.
()));
}
}
.
(
::
(
));
}
else
if
(
->
.
() ==
0
)
{
if
(
)
{
*
=
();
if
(!
td
->
(
description
::
<
>()) && !
td
->
(
description
::
<
>()))
{
->
.
(
::
ConstructorCannotImplicitlyConvertToType
(
,
.
()));
}
.
(
::
(
));
}
else
{
->
.
(
::
ConstructorCannotResolveType
(
));
}
}
else
{
*
=
nullptr
;
*
=
nullptr
;
if
(
)
{
if
(
() ==
::
)
{
auto
=
();
if
(
genericType
->
() ==
::
)
{
if
(
genericType
->
() ==
description
::
<
>()
||
genericType
->
() ==
description
::
<
>())
{
if
(
genericType
->
() ==
2
)
{
expectedKeyType
=
genericType
->
(
0
);
expectedValueType
=
genericType
->
(
1
);
}
}
else
if
(
genericType
->
() ==
description
::
<
>()
||
genericType
->
() ==
description
::
<
>()
||
genericType
->
() ==
description
::
<
>()
||
genericType
->
() ==
description
::
<
>())
{
if
(
genericType
->
() ==
1
)
{
expectedKeyType
=
genericType
->
(
0
);
}
}
}
}
}
bool
=
->
0
]
;
<
>
,
;
FOREACH(Ptr<WfConstructorArgument>, argument, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
{
<
>
=
(
,
argument
,
expectedKeyType
);
if
(!
keyType
)
{
keyType
newKeyType
;
}
else
if
(
auto
=
(
keyType
,
newKeyType
))
{
keyType
mergedType
;
}
else
{
->
.
(
::
(
,
keyType
.
(),
newKeyType
.
()));
}
}
if
(
map
)
{
<
>
=
(
,
argument
,
expectedValueType
);
if
(!
valueType
)
{
valueType
newValueType
;
}
else
if
(
auto
=
(
valueType
,
newValueType
))
{
valueType
mergedType
;
}
else
{
->
.
(
::
(
,
valueType
.
(),
newValueType
.
()));
}
}
}
if
(
map
)
{
if
(
keyType
&&
valueType
)
{
auto
=
<
>(
description
::
<
>(),
::
);
auto
=
<
>(
classType
);
genericType
(
keyType
);
genericType
(
valueType
);
auto
=
<
>(
genericType
);
.
(
::
(
pointerType
));
}
}
else
{
if
(
keyType
)
{
<
>
;
if
(
&&
()==
description
::
<
>())
{
classType
<
>(
description
::
<
>(),
::
);
}
else
{
classType
<
>(
description
::
<
>(),
::
);
}
auto
=
<
>(
classType
);
genericType
(
keyType
);
auto
=
<
>(
genericType
);
.
(
::
(
pointerType
));
}
}
}
}
void
(
*
)
override
{
auto
=
->
].
();
<
>
=
(
scope
,
->
);
<
>
=
(
,
->
,
type
);
if
(
expressionType
)
{
.
(
::
(
type
));
}
}
void
(
*
)
override
{
auto
=
->
].
();
if
(
auto
=
(
scope
,
->
))
{
if
(
auto
=
(
,
->
,
0
))
{
if
(!
(
expressionType
.
(),
type
.
(),
true
))
{
->
.
(
::
ExpressionCannotExplicitlyConvertToType
(
->
.
(),
expressionType
.
(),
type
.
()));
}
}
if
(
->
==
::
)
{
switch
(
type
())
{
case
::
:
case
::
:
case
::
:
break
;
default
:
->
.
(
::
(
->
.
(),
type
.
()));
}
}
.
(
::
(
type
));
}
}
void
(
*
)
override
{
<
>
=
(
,
->
,
0
);
if
(
type
)
{
switch
(
->
)
{
case
::
:
case
::
:
if
(!
(
type
.
()))
{
->
.
(
::
NullCannotImplicitlyConvertToType
(
->
.
(),
type
.
()));
}
break
;
default
:;
}
}
.
(
::
(
<
bool
>::
()));
}
void
(
*
)
override
{
.
(
::
(
<
*>::
()));
}
void
(
WfTypeOfExpressionExpression
*
)
override
{
(
,
->
,
0
);
.
(
::
(
<
*>::
()));
}
void
(
*
)
override
{
*
=
(
,
->
);
<
>
;
if
(
eventInfo
)
{
functionType
(
eventInfo
->
());
}
(
,
->
,
functionType
);
.
(
::
(
<
<
>>::
()));
}
void
(
*
)
override
{
(
,
->
);
<
>
=
<
<
>>::
();
(
,
->
,
pointerType
);
.
(
::
(
<
bool
>::
()));
}
void
(
*
)
override
{
<
>
=
(
,
->
,
0
);
<
>
;
if
(
parentType
)
{
if
(
->
==
::
)
{
*
=
parentType
();
*
=
0
;
{
auto
=
->
.
<
>();
propertyInfo
=
td
->
(
ref
.
,
true
);
if
(
propertyInfo
)
{
observeeType
(
propertyInfo
->
());
->
.
(
->
,
::
(
propertyInfo
));
}
else
{
->
.
(
::
(
ref
.
(),
td
,
ref
.
));
}
}
if
(
->
.
() ==
0
)
{
if
(
propertyInfo
)
{
*
=
propertyInfo
->
();
if
(!
eventInfo
)
{
eventInfo
=
td
->
(
propertyInfo
->
() +
L"Changed"
,
true
);
}
if
(!
eventInfo
)
{
->
.
(
::
(
->
.
(),
td
,
propertyInfo
->
() +
L"Changed"
));
}
}
}
else
{
FOREACH(Ptr<WfExpression>, eventExpr, node->events)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
eventExpr
);)
{
auto
=
eventExpr
.
<
>();
*
=
td
->
(
ref
.
,
true
);
if
(
info
)
{
->
.
(
eventExpr
,
::
(
info
));
}
else
if
(!
info
)
{
->
.
(
::
(
ref
.
(),
td
,
ref
.
));
}
}
}
}
else
{
auto
=
->
].
();
auto
=
scope
->
->
.
]
0
];
symbol
parentType
;
symbol
(
parentType
.
());
observeeType
(
,
->
,
0
);
FOREACH(Ptr<WfExpression>, eventExpr, node->events)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
eventExpr
);)
{
(
,
eventExpr
);
}
}
}
if
(
observeeType
)
{
.
(
::
(
observeeType
));
}
}
void
(
*
)
override
{
<
>
;
(
,
->
,
nullptr
,
true
,
functions
);
= -
1
;
<
>
=
(
,
,
->
,
functions
,
->
,
selectedFunctionIndex
);
if
(
resultType
)
{
->
.
(
->
,
functions
selectedFunctionIndex
]);
.
(
::
(
resultType
));
}
}
void
(
*
)
override
{
ValidateDeclarationSemantic
(
,
->
);
auto
=
->
->
.
()].
();
auto
=
<
>(
description
::
<
>(),
::
);
auto
=
<
>(
classType
);
genericType
(
(
scope
,
->
));
FOREACH(Ptr<WfFunctionArgument>, argument, node->function->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
genericType
(
scope
->
argument
.
]
0
]
);
}
auto
=
<
>(
genericType
);
.
(
::
(
pointerType
));
}
<
>
GetFunctionDeclarationType
(
*
,
<
>
)
{
<
>
=
(
->
.
()]
.
])
.
([decl](
<
>
)
{
return
symbol
;
})
.
();
return
symbol
;
}
class
NewInterfaceExpressionVisitor
:
public
empty_visitor
::
{
public
:
*
;
<
<
>>
;
<
<
>>
;
*
=
nullptr
;
NewInterfaceExpressionVisitor
(
*
)
:manager(
)
{
}
void
(
*
)
override
{
FOREACH(Ptr<WfDeclaration>, decl, node->expandedDeclarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
decl
(
this
);
}
}
void
(
*
)
override
{
CHECK_FAIL(L"NewInterfaceExpressionVisitor::Visit(WfVirtualCseDeclaration*)#Internal error, Temporary not supported.");
do
{
throw
(
L"NewInterfaceExpressionVisitor::Visit(WfVirtualCseDeclaration*)#Internal error, Temporary not supported."
);}
while
(
0
);
}
void
(
*
)
override
{
=
;
if
(
->
==
::
)
{
.
(
);
}
}
void
(
*
)
override
{
.
(
(
->
]
->
.
])
.
([=](
<
>
)
{
return
symbol
;
})
.
()
);
}
void
(
*
)
{
FOREACH(Ptr<WfDeclaration>, memberDecl, node->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
memberDecl
);)
{
memberDecl
(
this
);
ValidateDeclarationSemantic
(
,
memberDecl
);
}
}
};
void
(
*
)
override
{
auto
=
->
].
();
<
>
=
(
scope
,
->
);
if
(
type
)
{
*
=
type
();
*
=
td
->
();
<
>
;
*
=
nullptr
;
if
(!
ctors
||
ctors
->
() ==
0
)
{
->
.
(
::
ClassContainsNoConstructor
(
,
type
.
()));
}
else
{
if
((
td
->
()
::
) !=
::
)
{
<
>
;
for
(
=
0
;
i
<
ctors
->
();
i
++)
{
*
=
ctors
->
(
i
);
functions
.
(
::
(
info
));
}
= -
1
;
selectedType
(
,
,
nullptr
,
functions
,
->
,
selectedFunctionIndex
);
if
(
selectedType
)
{
selectedConstructor
=
functions
selectedFunctionIndex
].
;
}
}
else
if
((
td
->
()
::
) !=
::
)
{
->
.
(
::
ConstructorMixClassAndInterface
(
));
}
else
{
->
.
(
::
ClassContainsNoConstructor
(
,
type
.
()));
}
}
if
(
selectedType
)
{
auto
=
::
(
selectedConstructor
);
if
(!
(
selectedType
.
(),
type
.
()))
{
->
.
(
::
ConstructorReturnTypeMismatched
(
,
result
,
selectedType
.
(),
type
.
()));
}
.
(
result
);
}
}
}
void
(
*
)
override
{
auto
=
->
].
();
<
>
=
(
scope
,
->
);
if
(
type
)
{
*
=
type
();
*
=
td
->
();
<
>
;
*
=
nullptr
;
scope
->
=
td
;
if
(!
ctors
||
ctors
->
() ==
0
)
{
->
.
(
::
ClassContainsNoConstructor
(
,
type
.
()));
}
else
{
if
((
td
->
()
::
) !=
::
)
{
->
.
(
::
ConstructorMixClassAndInterface
(
));
}
else
if
((
td
->
()
::
) !=
::
)
{
if
(
auto
=
(
td
))
{
selectedType
(
info
->
());
selectedConstructor
=
info
;
}
else
{
->
.
(
::
InterfaceContainsNoConstructor
(
,
type
.
()));
}
<
,
*>
;
<
,
<
>>
;
{
NewInterfaceExpressionVisitor
(
);
declVisitor
.
(
);
if
(
declVisitor
.
)
{
FOREACH(Ptr<WfFunctionDeclaration>, func, declVisitor.overrideFunctions)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
declVisitor
.
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
func
);)
{
implementMethods
.
(
func
.
,
func
);
}
auto
=
->
declVisitor
.
];
<
<
>>
;
(
readonlySymbols
,
(
capture
).Except(
declVisitor
.
));
(
capture
,
declVisitor
.
);
(
capture
,
readonlySymbols
,
true
);
}
}
{
<
*>
;
<
*>
;
types
.
(
td
);
=
0
;
while
(
begin
<
types
.
())
{
*
=
types
begin
++];
if
(
searchedTypes
.
(
currentType
))
{
continue
;
}
searchedTypes
.
(
currentType
);
=
currentType
->
GetBaseTypeDescriptorCount
();
for
(
=
0
;
i
<
count
;
i
++)
{
types
.
(
currentType
->
(
i
));
}
count
=
currentType
->
();
for
(
=
0
;
i
<
count
;
i
++)
{
*
=
currentType
->
(
i
);
=
group
->
();
for
(
=
0
;
j
<
methodCount
;
j
++)
{
auto
=
group
->
(
j
);
if
(!
method
->
())
{
interfaceMethods
.
(
group
->
(),
method
);
}
}
}
}
}
auto
= [=](
const
&
,
const
<
*>&
)
{
FOREACH(IMethodInfo*, method, methods)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
methods
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
method
);)
{
->
.
(
::
InterfaceMethodNotImplemented
(
,
method
));
}
};
auto
= [=](
const
&
,
const
<
<
>>&
)
{
FOREACH(Ptr<WfFunctionDeclaration>, decl, methods)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
methods
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
<
>
=
GetFunctionDeclarationType
(
scope
,
decl
);
->
.
(
::
(
decl
.
(),
type
.
(),
declType
.
()));
}
};
(
interfaceMethods
,
implementMethods
,
discardFirst
,
discardSecond
,
[=](
const
&
,
const
<
*>&
,
const
<
<
>>&
)
{
<
,
*>
;
<
,
<
>>
;
FOREACH(IMethodInfo*, method, interfaces)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
interfaces
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
method
);)
{
<
>
=
CreateTypeInfoFromMethodInfo
(
method
);
typedInterfaceMethods
.
(
methodType
(),
method
);
}
FOREACH(Ptr<WfFunctionDeclaration>, decl, implements)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
implements
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
<
>
=
GetFunctionDeclarationType
(
scope
,
decl
);
typedImplementMethods
.
(
methodType
(),
decl
);
}
(
typedInterfaceMethods
,
typedImplementMethods
,
discardFirst
,
discardSecond
,
[=](
const
&
,
const
<
*>&
,
const
<
<
>>&
)
{
if
(
interfaces
.
() >
1
)
{
<
>
;
FOREACH(IMethodInfo*, method, interfaces)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
interfaces
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
method
);)
{
functions
.
(
::
(
method
));
->
.
(
::
CannotPickOverloadedInterfaceMethods
(
,
functions
));
}
}
if
(
implements
.
() >
1
)
{
auto
=
implements
0
];
<
>
=
GetFunctionDeclarationType
(
scope
,
decl
);
->
.
(
::
CannotPickOverloadedImplementMethods
(
decl
.
(),
methodType
.
()));
}
if
(
interfaces
.
() ==
1
&&
implements
.
() ==
1
)
{
->
.
(
implements
0
].
(),
interfaces
0
]);
}
});
});
}
else
{
->
.
(
::
ClassContainsNoConstructor
(
,
type
.
()));
}
}
if
(
selectedType
)
{
auto
=
::
(
selectedConstructor
);
if
(!
(
selectedType
.
(),
type
.
()))
{
->
.
(
::
ConstructorReturnTypeMismatched
(
,
result
,
selectedType
.
(),
type
.
()));
}
.
(
result
);
}
}
}
void
(
*
)
override
{
if
(
(
,
->
,
))
{
.
(
->
->
.
()]);
}
}
void
(
*
)
override
{
bool
=
->
;
=
->
.
();
->
((
::
*)
this
);
if
(!
expanded
&&
->
.
() ==
errorCount
)
{
ExpandVirtualExpressionVisitor
(
,
);
->
(&
visitor
);
if
(!
->
)
{
return
;
}
(
->
,
->
);
auto
=
->
];
if
(
parentScope
)
{
parentScope
parentScope
;
}
ContextFreeExpressionDesugar
(
,
->
);
(
,
parentScope
,
->
);
->
checkedScopes_DuplicatedSymbol
.
(
parentScope
.
());
->
.
(
parentScope
.
());
if
(!
CheckScopes_DuplicatedSymbol
(
) || !
(
))
{
return
;
}
}
if
(
->
)
{
if
(
.
() ==
1
)
{
(
,
->
,
0
].
);
}
else
{
(
,
->
,
nullptr
);
}
}
}
void
(
*
)
override
{
(
,
->
,
0
);
.
(
::
(
<
<
>>::
()));
}
void
(
*
)
override
{
<
>
=
<
<
>>::
();
.
(
::
(
typeInfo
));
ValidateStatementSemantic
(
,
->
);
}
void
(
*
)
override
{
auto
=
->
].
();
auto
=
(
scope
,
->
);
auto
=
(
,
->
,
0
);
if
(
type
&&
expressionType
)
{
.
(
::
(
type
));
if
(
expressionType
)
{
auto
=
expressionType
();
auto
=
type
();
if
((
fromTd
->
()
::
) !=
::
)
{
if
((
toTd
->
()
::
) !=
::
)
{
if
(
fromTd
!=
toTd
&&
toTd
->
(
fromTd
))
{
goto
PASS_VALIDATION;
}
}
}
->
.
(
::
(
,
type
.
(),
expressionType
.
()));
PASS_VALIDATION:;
}
}
}
void
(
WfExpectedTypeCastExpression
*
)
override
{
(
,
->
,
nullptr
);
if
(
)
{
.
(
::
(
));
}
else
{
->
.
(
::
ExpectedTypeCastCannotResolveType
(
));
}
}
void
(
*
)
override
{
auto
=
->
].
();
auto
=
scope
->
();
if
(
auto
=
functionScope
->
.
<
>())
{
if
(
funcDecl
.
<
>())
{
auto
=
->
funcDecl
.
()];
auto
=
providerScope
[
L"$PROVIDER"
][
0
];
auto
=
providerScope
[
L"$IMPL"
][
0
];
if
(
providerSymbol
->typeInfo &&
implSymbol
->typeInfo)
{
<
>
;
if
(
auto
=
providerSymbol
->typeInfo->GetTypeDescriptor()->GetMethodGroupByName(
L"QueryContext"
,
true
))
{
=
group
->GetMethodCount();
for
(
=
0
;
i
<
count
;
i
++)
{
auto
=
group
->GetMethod(
i
);
if
(
method
->IsStatic())
{
if
(
method
->GetParameterCount() ==
1
&&
(
implSymbol
->typeInfo.Obj(),
method
->GetParameter(
0
)->GetType()))
{
methods
.
(
::
(
method
));
}
}
}
}
if
(
methods
.
() >
1
)
{
->
.
(
::
CannotPickOverloadedFunctions
(
,
methods
));
}
else
if
(
methods
.
() ==
1
)
{
auto
=
methods
0
].
->
();
<
*>
;
->
(
contextType
->
(),
->
.
,
false
,
searchedTypes
,
);
if
(
.
() ==
0
)
{
->
.
(
::
(
,
contextType
->
(),
->
.
));
}
}
else
{
->
.
(
::
(
,
providerSymbol
->typeInfo.Obj()));
}
}
}
}
}
static
void
(
<
>
,
*
,
<
>
,
<
>&
)
{
ValidateSemanticExpressionVisitor
(
,
,
);
(&
visitor
);
}
};
class
ValidateConstantExpressionVisitor
:
public
empty_visitor
::
,
public
empty_visitor
::
VirtualCseExpressionVisitor
{
public
:
*
;
bool
=
false
;
ValidateConstantExpressionVisitor
(
*
)
:manager(
)
{
}
bool
(
<
>
)
{
bool
=
;
=
false
;
(
this
);
bool
=
;
=
cache
;
return
result
;
}
void
(
*
,
const
&
)
{
auto
=
->
];
if
(
auto
=
result
.
()->
())
{
=
enumType
->
(
);
if
(
index
!= -
1
)
{
=
true
;
}
}
}
void
(
*
)
override
{
->
(
this
);
}
void
(
*
)
override
{
->
((
::
*)
this
);
}
void
(
*
)
override
{
(
,
->
.
);
}
void
(
*
)
override
{
(
,
->
.
);
}
void
(
*
)
override
{
=
true
;
}
void
(
*
)
override
{
=
true
;
}
void
(
*
)
override
{
=
true
;
}
void
(
*
)
override
{
=
true
;
}
void
(
*
)
override
{
=
true
;
}
void
(
WfTypeOfExpressionExpression
*
)
override
{
=
true
;
}
static
void
(
<
>
,
*
,
<
>
)
{
if
(
(
,
,
))
{
ValidateConstantExpressionVisitor
(
);
(&
visitor
);
if
(!
visitor
.
)
{
->
.
(
::
(
.
()));
}
}
}
};
void
ValidateExpressionSemantic
(
*
,
<
>
,
<
reflection
::
description
::
>
,
collections
::
<
>&
)
{
ValidateSemanticExpressionVisitor
::
(
,
,
,
);
for
(
=
.
() -
1
;
i
>=
0
;
i
--)
{
auto
=
i
];
if
(
result
.
&&
result
.
.
() >
0
)
{
<
>
;
FOREACH(Ptr<WfDeclaration>, decl, result.scopeName->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
result
.
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
=
->
.
().
(
decl
.
());
if
(
index
== -
1
)
continue
;
auto
=
->
.
()
index
];
if
(
scope
decl
)
{
scope
scope
;
}
index
=
scope
.
().
(
decl
.
);
if
(
index
== -
1
)
continue
;
FOREACH(Ptr<WfLexicalSymbol>, symbol, scope->symbols.GetByIndex(index))
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
scope
.
(
index
));
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
symbol
);)
{
if
(
symbol
decl
&&
symbol
)
{
replaces
.
(
::
(
symbol
));
}
}
}
if
(
replaces
.
() >
0
)
{
.
(
i
);
FOREACH_INDEXER(ResolveExpressionResult, replaceResult, index, replaces)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
replaces
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
replaceResult
);
index
++)
{
.
(
i
+
index
,
replaceResult
);
}
}
}
}
}
void
ValidateConstantExpression
(
*
,
<
>
,
<
reflection
::
description
::
>
)
{
ValidateConstantExpressionVisitor
::
(
,
,
);
}
}
}
}