Show
Ignore:
Timestamp:
09/09/09 20:18:36 (3 months ago)
Author:
skilpat
Message:

[ast] Split CoercionInvocation? node into three subnodes for traits, tuples, and arrows. Subsequent refactoring. Fixed bug in CollectingVisitor? generation.
[scala] Added a couple utility methods in scala_src.useful.Lists.
[desugarer] Flesh out the CoercionDesugarer? to desugar all types of CoercionInvocations? into function applications.
[type checker] Refactored some code for function application for use by coercions code. Changed CoercionOracle? to actually build the CoercionInvocation? nodes while checking the "coerces to" relation. Consequently the FnRefs? used in the final rewriting of coercion invocations are created here. Weird, but avoids some even more complicated work in the CoercionDesugarer?.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/astgen/Fortress.ast

    r4096 r4149  
    931931                         * after inferring the implicit coercion invocations 
    932932                         */ 
    933                         CoercionInvocation(Type toType, 
    934                                            List<StaticArg> staticArgs, 
    935                                            Expr arg); 
     933                        abstract CoercionInvocation(Type toType, 
     934                                                    Expr arg); 
     935                            /** 
     936                             * Coercion invocation to a trait type. The FnRef is 
     937                             * the actual function that coercion calls, along 
     938                             * with any static args for the coercion. 
     939                             */ 
     940                            TraitCoercionInvocation( 
     941                                TraitType toType, 
     942                                FnRef coercionFn); 
     943                            /** 
     944                             * Coercion invocation to a tuple type. Each type 
     945                             * in the tuple may or may not require a coercion; 
     946                             * the list of options corresponds to those that do. 
     947                             */ 
     948                            TupleCoercionInvocation( 
     949                                TupleType toType, 
     950                                List<Option<CoercionInvocation>> subCoercions, 
     951                                Option<Option<CoercionInvocation>> varargCoercion); 
     952                            /** 
     953                             * Coercion invocation to an arrow type. Each type 
     954                             * in the arrow may or may not require a coercion; 
     955                             * the two options correspond to those that do. 
     956                             */ 
     957                            ArrowCoercionInvocation( 
     958                                ArrowType toType, 
     959                                Option<CoercionInvocation> domainCoercion, 
     960                                Option<CoercionInvocation> rangeCoercion); 
    936961                        /** 
    937962                         * a method invocation