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

Scala example source code file (bug1381.scala)

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

d, d, ev, id, int, iv, pv, pv, v, valuetype, variable, variable, vt, vt

The Scala bug1381.scala source code

import scala.reflect.Manifest

class D[V <: Variable]

class ID[V<:IV] extends D[V] {
  type E = V#ValueType
  def index(value:E) : Int = 0
  // Comment this out to eliminate crash.  Or see below
  def index(values:E*) : Iterable[Int] = null
}

abstract class Variable {
  type VT <: Variable
  def d : D[VT] = null
}

abstract class PV[T](initval:T) extends Variable  {
  type VT <: PV[T]
  type ValueType = T
}

trait IV extends Variable  {
  type ValueType
}

abstract class EV[T](initval:T) extends PV[T](initval) with IV {
  type VT <: EV[T]
  override def d : ID[VT] = null
  // Comment this out to eliminate crash
  protected var indx = d.index(initval)
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala bug1381.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.