@viktorklang Yeah, that's nice and unambiguous. Just seems a bit clunky...
-
-
Replying to @propensive
@propensive Absolutely. Thinking of which, you could most probably create an `alloc` macro to allow for: `val foo = alloc[Foo](bar, baz)`1 reply 0 retweets 0 likes -
Replying to @viktorklang
@viktorklang Yes, that's what I wanted to do.@xeno_by said I couldn't access the expected type, so `alloc(bar, baz): Foo` would never work.1 reply 0 retweets 0 likes -
Replying to @propensive
@propensive@xeno_by Could you elaborate on that? :-)2 replies 0 retweets 0 likes -
Replying to @viktorklang
@viktorklang@xeno_by i.e. it could be as simple as writing `val foo: Foo = alloc`, (provided Foo has a zero-arity constructor).1 reply 0 retweets 0 likes -
Replying to @propensive
@propensive@xeno_by I'd be fine with not having inference for it, it'd just be cleaner.2 replies 0 retweets 0 likes -
Replying to @viktorklang
@viktorklang@xeno_by `val x: Foo[String] = new Foo()` currently infers the type parameter nicely.1 reply 0 retweets 0 likes -
Replying to @propensive
@propensive@xeno_by asInstanceOf doesn't have inference: scala> val s: String = ("": AnyRef).asInstanceOf java.lang.ClassCastException: …1 reply 0 retweets 0 likes -
Replying to @viktorklang
@viktorklang@xeno_by No, but it works in situations like this: https://gist.github.com/propensive/f0e5087ee960a7b42363 …1 reply 0 retweets 0 likes -
Replying to @propensive
@propensive@xeno_by What I am saying that I find it asymmetrical :)1 reply 0 retweets 0 likes
@viktorklang @xeno_by Yeah. Best solution would be for asInstanceOf to be inferred too. Well, sorta... IIRC, this was one the case...
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.