@@ -1751,7 +1751,9 @@ bool TypeChecker::visit(UnaryOperation const& _operation)
1751
1751
else
1752
1752
_operation.annotation ().type = result.get ();
1753
1753
_operation.annotation ().isConstant = false ;
1754
- _operation.annotation ().isPure = !modifying && *_operation.subExpression ().annotation ().isPure ;
1754
+ _operation.annotation ().isPure =
1755
+ !modifying &&
1756
+ *_operation.subExpression ().annotation ().isPure ;
1755
1757
_operation.annotation ().isLValue = false ;
1756
1758
1757
1759
return false ;
@@ -3750,8 +3752,9 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
3750
3752
solAssert (m_errorReporter.hasErrors ());
3751
3753
return ;
3752
3754
}
3753
- solAssert (_usingFor.typeName ()->annotation ().type );
3754
- if (Declaration const * typeDefinition = _usingFor.typeName ()->annotation ().type ->typeDefinition ())
3755
+ Type const * usingForType = _usingFor.typeName ()->annotation ().type ;
3756
+ solAssert (usingForType);
3757
+ if (Declaration const * typeDefinition = usingForType->typeDefinition ())
3755
3758
{
3756
3759
if (typeDefinition->scope () != m_currentSourceUnit)
3757
3760
m_errorReporter.typeError (
@@ -3785,10 +3788,12 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
3785
3788
return ;
3786
3789
}
3787
3790
3788
- solAssert (_usingFor.typeName ()->annotation ().type );
3791
+ Type const * usingForType = _usingFor.typeName ()->annotation ().type ;
3792
+ solAssert (usingForType);
3793
+
3789
3794
Type const * normalizedType = TypeProvider::withLocationIfReference (
3790
3795
DataLocation::Storage,
3791
- _usingFor. typeName ()-> annotation (). type
3796
+ usingForType
3792
3797
);
3793
3798
solAssert (normalizedType);
3794
3799
@@ -3824,7 +3829,7 @@ void TypeChecker::endVisit(UsingForDirective const& _usingFor)
3824
3829
" The function \" {}\" cannot be bound to the type \" {}\" because the type cannot "
3825
3830
" be implicitly converted to the first argument of the function (\" {}\" ){}" ,
3826
3831
joinHumanReadable (path->path (), " ." ),
3827
- _usingFor. typeName ()-> annotation (). type ->toString (true /* withoutDataLocation */ ),
3832
+ usingForType ->toString (true /* withoutDataLocation */ ),
3828
3833
functionType->selfType ()->humanReadableName (),
3829
3834
result.message ().empty () ? " ." : " : " + result.message ()
3830
3835
)
0 commit comments