mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2025-02-12 08:31:01 +00:00
drop intersection types test
This commit is contained in:
parent
f4a091a79f
commit
82eaac780e
@ -1,5 +0,0 @@
|
||||
package com.htmlism.usingtypes
|
||||
|
||||
class Accumulator {
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package com.htmlism.usingtypes
|
||||
|
||||
// cannot reconcile adding `A : Reg` when needing `Reg[A & B]`
|
||||
class AsmProgram[+A]:
|
||||
def join[B](that: AsmProgram[B]): AsmProgram[A & B] =
|
||||
new AsmProgram
|
||||
|
||||
def use: Int =
|
||||
4
|
@ -1,30 +0,0 @@
|
||||
package com.htmlism.usingtypes
|
||||
|
||||
trait Reg[+A]:
|
||||
def get: A
|
||||
|
||||
object Reg:
|
||||
given accumulatorReg: Reg[Accumulator] with
|
||||
def get: Accumulator =
|
||||
new Accumulator
|
||||
|
||||
given xReg: Reg[RegisterX] with
|
||||
def get: RegisterX =
|
||||
new RegisterX
|
||||
|
||||
given yReg: Reg[RegisterY] with
|
||||
def get: RegisterY =
|
||||
new RegisterY
|
||||
|
||||
object Playground extends App:
|
||||
private val first =
|
||||
new AsmProgram[Accumulator]
|
||||
|
||||
private val second =
|
||||
new AsmProgram[RegisterX]
|
||||
|
||||
private val both: AsmProgram[Accumulator & RegisterX] =
|
||||
first
|
||||
.join(second)
|
||||
|
||||
println(both.use)
|
@ -1,5 +0,0 @@
|
||||
package com.htmlism.usingtypes
|
||||
|
||||
class RegisterX {
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
package com.htmlism.usingtypes
|
||||
|
||||
class RegisterY {
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user