-
-
Save rightfold/4d4020315e21fe39b0fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
meth f a b : int // dispatch based on runtime type of a and b | |
interface baseOfTAndV | |
f _ baseOfUAndW | |
end | |
interface baseOfUAndW | |
f baseOfTAndV _ | |
end | |
struct T; end | |
struct U; end | |
struct V; end | |
struct W; end | |
impl f (a: T) (b: U) : int; …; end | |
impl f (a: V) (b: W) : int; …; end | |
var a: baseOfTAndV = random [makeT!, makeV!] | |
var b: baseOfUAndW = random [makeU!, makeW!] | |
f a b // error; f T W and f U V not implemented |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment