alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (bug2619.scala)

This example Scala source code file (bug2619.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

abstractmodule, int, list, list, moduleag, moduleai, modulebe, modulebg, moduletype1, moduletype1, moduletype2, moduletype2, nil, nil

The Scala bug2619.scala source code

abstract class F {
    final def apply(x: Int): AnyRef = null
}
abstract class AbstractModule {
    def as: List[AnyRef]
    def ms: List[AbstractModule]
    def fs: List[F] = Nil
    def rs(x: Int): List[AnyRef] = fs.map(_(x))
}
abstract class ModuleType1 extends AbstractModule {}
abstract class ModuleType2 extends AbstractModule {}

object ModuleAE extends ModuleType1 {
    def as = Nil
    def ms = Nil
}
object ModuleAF extends ModuleType2 {
    def as = Nil
    def ms = List(ModuleAE)
}
object ModuleAG extends ModuleType1 {
    def as = List("")
    def ms = Nil
}
object ModuleAI extends ModuleType1 {
    def as = Nil
    def ms = List(ModuleAE)
}
object ModuleAK extends ModuleType2 {
    def as = Nil
    def ms = List(ModuleAF)
}
object ModuleAL extends ModuleType1 {
    def as = Nil
    def ms = List(
        ModuleAG,
        ModuleAI
    )
}
object ModuleAM extends ModuleType1 {
    def as = Nil
    def ms = List(
        ModuleAL,
        ModuleAE
    ) ::: List(ModuleAK)
}
object ModuleBE extends ModuleType1 {
    def as = Nil
    def ms = Nil
}
object ModuleBF extends ModuleType2 {
    def as = Nil
    def ms = List(ModuleBE)
}
object ModuleBG extends ModuleType1 {
    def as = List("")
    def ms = Nil
}
object ModuleBI extends ModuleType1 {
    def as = Nil
    def ms = List(ModuleBE)
}
object ModuleBK extends ModuleType2 {
    def as = Nil
    def ms = List(ModuleBF)
}
object ModuleBL extends ModuleType1 {
    def as = Nil
    def ms = List(
        ModuleBG,
        ModuleBI
    )
}
object ModuleBM extends ModuleType1 {
    def as = Nil
    def ms = List(
        ModuleBL,
        ModuleBE
    ) ::: List(ModuleBK)
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala bug2619.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.