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

Scala example source code file (bug783.scala)

This example Scala source code file (bug783.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

analyzer, analyzer, app, contexts, contexts, global, global, int, int, main, template

The Scala bug783.scala source code

package test;

object Main extends App {
  class Global {
    case class Template(x : Int, y : Int) {
      Console.println("outer: " + Global.this);
    }
  }
  trait Contexts { self: Analyzer =>
    val xxx : global.Template = {
      assert(globalInit0 != null);
      globalInit0.Template(10, 20);
    }
  }
  abstract class Analyzer extends Contexts {
    type Global <: Main.Global;
    final val global : Global = globalInit;
    def globalInit : Global;
    final def globalInit0 = globalInit.asInstanceOf[global.type];
  }
  
  object global0 extends Global {
    object analyzer extends Analyzer {
      type Global = global0.type;
      override def globalInit = global0;
    }
  }
  Console.println(global0.analyzer.xxx);
}

Other Scala examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.