|
Revision 3550, 1.2 KB
(checked in by sukyoungryu, 9 months ago)
|
|
[copyright] Fixed the copyright notices.
|
| Line | |
|---|
| 1 | (******************************************************************************* |
|---|
| 2 | Copyright 2009 Sun Microsystems, Inc., |
|---|
| 3 | 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
|---|
| 4 | All rights reserved. |
|---|
| 5 | |
|---|
| 6 | U.S. Government Rights - Commercial software. |
|---|
| 7 | Government users are subject to the Sun Microsystems, Inc. standard |
|---|
| 8 | license agreement and applicable provisions of the FAR and its supplements. |
|---|
| 9 | |
|---|
| 10 | Use is subject to license terms. |
|---|
| 11 | |
|---|
| 12 | This distribution may include materials developed by third parties. |
|---|
| 13 | |
|---|
| 14 | Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered |
|---|
| 15 | trademarks of Sun Microsystems, Inc. in the U.S. and other countries. |
|---|
| 16 | ******************************************************************************) |
|---|
| 17 | |
|---|
| 18 | component HiLoInference |
|---|
| 19 | |
|---|
| 20 | export Executable |
|---|
| 21 | |
|---|
| 22 | trait T |
|---|
| 23 | end |
|---|
| 24 | |
|---|
| 25 | trait U extends T |
|---|
| 26 | end |
|---|
| 27 | |
|---|
| 28 | trait V extends U |
|---|
| 29 | end |
|---|
| 30 | |
|---|
| 31 | object ov extends V end |
|---|
| 32 | |
|---|
| 33 | object ou extends U end |
|---|
| 34 | |
|---|
| 35 | object ot extends T end |
|---|
| 36 | |
|---|
| 37 | f[\W\](x:W, e:W->W) = println "F called" |
|---|
| 38 | |
|---|
| 39 | g(t:T):T = t |
|---|
| 40 | h(u:U):U = u |
|---|
| 41 | i(u:U):T = u |
|---|
| 42 | j(v:V):V = v |
|---|
| 43 | k(v:V):U = v |
|---|
| 44 | l(v:V):T = v |
|---|
| 45 | |
|---|
| 46 | run():() = do |
|---|
| 47 | f(ot, g) |
|---|
| 48 | |
|---|
| 49 | f(ou, g) |
|---|
| 50 | f(ou, h) |
|---|
| 51 | f(ou, i) |
|---|
| 52 | |
|---|
| 53 | f(ov, g) |
|---|
| 54 | f(ov, h) |
|---|
| 55 | f(ov, i) |
|---|
| 56 | f(ov, j) |
|---|
| 57 | f(ov, k) |
|---|
| 58 | f(ov, l) |
|---|
| 59 | end |
|---|
| 60 | |
|---|
| 61 | end |
|---|