Skip to content

Instantly share code, notes, and snippets.

@lyricallogical
Created February 7, 2011 16:43
Show Gist options
  • Save lyricallogical/814689 to your computer and use it in GitHub Desktop.
Save lyricallogical/814689 to your computer and use it in GitHub Desktop.
module A
export type Base
export val global.f : Base -> Base -> Ret # vtbl 作りたいけど、作れない
module B
export type X can cast from Base
export val global.f : X -> Base -> Ret
module C
export type Y can cast from Base
export val global.f : Base -> Y -> Ret
module D
import B, C
call global.f x, y # conflict!!!
------------------
module A
export abstract type Base
export virtual method global.f : Base -> Ret # vtbl 作りたいけど、作れない
module B
export type X <: Base
export virtual method global.f : X -> Ret
module C
export type Y <: Base
export virtual method global.f : Y -> Ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment