private static boolean isDynamic( IType type ) { return type != null && (type.isDynamic() || (type instanceof IGosuClass && ((IGosuClass)type).isStructure())); }
private IType useDynamicTypeIfDynamicRoot( IInvocableType funcType, IType ctxType ) { if( funcType instanceof FunctionType && ((FunctionType)funcType).getMethodInfo() != null ) { IMethodInfo mi = ((FunctionType)funcType).getMethodInfo(); if( mi.getOwnersType().isDynamic() ) { ctxType = ((FunctionType)funcType).getReturnType(); } } return ctxType; }
private boolean supportsInitializer( IType type ) { if( type == null ) { return false; } return type.isArray() || JavaTypes.MAP().isAssignableFrom( type ) || JavaTypes.SET().isAssignableFrom( type ) || JavaTypes.LIST().isAssignableFrom( type ) || JavaTypes.COLLECTION().equals( type.getGenericType() ) || JavaTypes.ITERABLE().equals( type.getGenericType() ) || type.isDynamic(); }
private String getReflectiveName( IAttributedFeatureInfo pi, IType rootType, ITypeInfo rootTypeInfo ) { if( rootType.isDynamic() || isExpando( rootType ) ) { IAnnotationInfo actualNameAnno = pi.getAnnotation( JavaTypes.ACTUAL_NAME() ); if( actualNameAnno != null ) { // Must use actual name reflectively in case name is not a legal identifier return (String)actualNameAnno.getFieldValue( "value" ); } } else if( rootTypeInfo instanceof IRelativeTypeInfo && ((IRelativeTypeInfo)rootTypeInfo).getProperty( rootType, pi.getName() ).isPrivate() ) { // Private members must be accessed reflectively return pi.getName(); } return null; }
private void _parseInitializerExpression( ContextType type ) { if( type != null && JavaTypes.COLLECTION().isAssignableFrom( type.getType() ) ) { parseCollectionInitializerList( type.getType() ); } else if( type != null && JavaTypes.MAP().isAssignableFrom( type.getType() ) ) { parseMapInitializerList( type ); } else if( type.getType().isDynamic() ) { parseCollectionInitializerList( type.getType() ); } else { BadInitializerExpression be = new BadInitializerExpression(); pushExpression(be); } }
private void parseCollectionInitializerList( IType type ) { CollectionInitializerExpression lie = new CollectionInitializerExpression(); IType componentType; if( type.isDynamic() ) { componentType = type.getComponentType(); } else { IType listType = TypeLord.findParameterizedTypeInHierarchy( type, JavaTypes.COLLECTION() ); if( listType.isParameterizedType() && !listType.isGenericType() ) { componentType = listType.getTypeParameters()[0]; } else { componentType = JavaTypes.OBJECT(); } } do { parseExpression( new ContextType( componentType ) ); Expression e = popExpression(); lie.add( e ); } while( match( null, ',' ) ); lie.setType( type ); pushExpression( lie ); }
if( classBean.isDynamic() )
if( symbolType.isDynamic() )
Expression e = popExpression(); IType type = e.getType(); verify( e, type == JavaTypes.pBOOLEAN() || type == JavaTypes.BOOLEAN() || type.isDynamic(), Res.MSG_TYPE_MISMATCH, "boolean", type.getDisplayName() ); e = possiblyWrapWithImplicitCoercion( e, JavaTypes.pBOOLEAN() ); ue.setExpression( e ); if( verify( e, !type.isDynamic(), Res.MSG_DYNAMIC_TYPE_NOT_ALLOWED_HERE ) )
rhs.getType() instanceof IErrorType || !rhsType.isAssignableFrom( lhs.getType() ) || rhsType.isDynamic(), Res.MSG_UNNECESSARY_COERCION, lhs.getType().getRelativeName(), rhsType.getRelativeName() );
? MapAccess.getKeyType( rootType ) : null; boolean bDynamicRoot = rootType.isDynamic(); if( bDynamicRoot )
NewExpression e = new InferredNewExpression(); boolean bPlaceholder = ctxType != null && ctxType.isDynamic(); if( ctxType == null || bPlaceholder )
ArrayList<ISymbol> args = parseParameterDeclarationList( block, false, inferredContextTypes, false, false, false, type != null && type.isDynamic() ); args.forEach( _symTable::putSymbol ); foundArrow = verify( block, match( null, "->", SourceCodeTokenizer.TT_OPERATOR ), Res.MSG_EXPECTING_ARROW_AFTER_BLOCK_ARGS );
if( lhsType.isDynamic() && !isNumberType( asType ) && (ILanguageLevel.Util.STANDARD_GOSU() || asType != JavaTypes.STRING()) ) { return checkCast( asType, root );