Skip to content

Instantly share code, notes, and snippets.

@gtani7
Created October 25, 2011 10:50
Show Gist options
  • Save gtani7/1312269 to your computer and use it in GitHub Desktop.
Save gtani7/1312269 to your computer and use it in GitHub Desktop.
Dependent method types
scala> trait Foo { type Bar }
defined trait Foo
scala> def withFoo(foo: Foo): foo.Bar = // The return type depends on the parameter!
| sys.error("Not yet implemented")
withFoo: (foo: Foo)foo.Bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment