Show
Ignore:
Timestamp:
10/31/09 15:34:55 (3 weeks ago)
Author:
jmaessen
Message:

[codegen, typechecking] Single inheritance of methods. Uses java
inheritance from boilerplate classes. Multiple inheritance is coming,
but will require wrappers for methods inherited from traits other than
the leftmost (enumerating exactly these methods could prove a bit
fiddly).

Fixed typechecker so that method applications that use an implicit
receiver (_RewriteFnApp nodes) are transformed into dotted method
applications (MethodInvocation nodes). This is done after type
checking in order to avoid some unusual corner cases in the type of
self in object expressions. As these expressions must be hoisted
before code generation, this is the least of our troubles on that
front.

Did some minor tweaks to conversions between java and Scala types to
use idioms for List conversion recommended by the Scala community;
this seems to speed compilation up noticeably during testing. Some
more care may be warranted here; more careful code generation
for FortressAst.scala in astgen may produce big payoffs in run time.

Location:
trunk/ProjectFortress/compiler_tests
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/compiler_tests/SingleInheritance.fss

    r4254 r4300  
    2424  n():String = "O(" x.asString "," y.asString ").n " self.m("a","b") 
    2525  p():String = "O(" x.asString "," y.asString ").p " m("e","f") 
     26  q():String = n() 
    2627end 
    2728 
    2829run() = do 
    2930  o = O(1,2) 
     31  println(o.m("c","d")) 
    3032  println(o.n()) 
    3133  println(o.p()) 
    32   println(o.m("c","d")) 
     34  println(o.q()) 
    3335end