Re: [swift-dev] Descriptive Protocol non-conformance errors

2016-07-08 Thread Ted kremenek via swift-dev
> On Jul 6, 2016, at 8:24 PM, Douglas Gregor via swift-dev > wrote: > > >> On Jun 25, 2016, at 1:19 PM, Sean Alling via swift-dev >> wrote: >> >> Hi everyone, >> >> I’m suggesting a change to the compiler that returns an error when an object >> 'does not conform to protocol’ to nest sub-

[swift-dev] Optimal Work Flow

2016-07-08 Thread Lau Bao via swift-dev
Hi everyone , I am new the the mailing list and am trying to figure out a optimal work flow. I am currently making a change in the stdlib and building the tool chain through the (swift/utils/build-toolchain) and debugging toolchain via REPL and break pointing code to step from test code in to std

Re: [swift-dev] Type inference of functions with more than one statement

2016-07-08 Thread Ross LeBeau via swift-dev
Filed here: https://bugs.swift.org/browse/SR-2033 Thanks for the help! Cool to learn a new thing about Swift today :) -- Ross LeBeau On July 8, 2016 at 2:57:55 PM, Slava Pestov (spes...@apple.com) wrote: "Did not infer types, try explicitly declaring them" _

Re: [swift-dev] Type inference of functions with more than one statement

2016-07-08 Thread Slava Pestov via swift-dev
Hi Ross, That's a good point. Do you mind filing a JIRA issue for this? Slava > On Jul 8, 2016, at 11:56 AM, Ross LeBeau wrote: > > Hi Slava, > > Thanks for the insight. This is what I suspected, but I wasn't sure about how > set the team was on this concept. Currently, it seems that if the

Re: [swift-dev] Type inference of functions with more than one statement

2016-07-08 Thread Ross LeBeau via swift-dev
Hi Slava, Thanks for the insight. This is what I suspected, but I wasn't sure about how set the team was on this concept. Currently, it seems that if the types cannot be inferred, the type checker picks an implementation and checks against that. E.g., the following code works because it conforms

Re: [swift-dev] Type inference of functions with more than one statement

2016-07-08 Thread Slava Pestov via swift-dev
Hi Ross, Swift's type inference operates at the level of a single statement. This is why we can infer parameter and return types for single-expression closures. While conceptually, it would not be a huge change to the type checker algorithm to support global type inference for closures and othe

[swift-dev] Build issue on amd64

2016-07-08 Thread Richard Neese via swift-dev
Linux swift 4.6.0-1-amd64 #1 SMP Debian 4.6.2-2 (2016-06-25) x86_64 GNU/Linux root@swift:~# clang -v Debian clang version 3.6.2-3 (tags/RELEASE_362/final) (based on LLVM 3.6.2) Target: x86_64-pc-linux-gnu Thread model: posix Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8

Re: [swift-dev] id-as-Any and ObjC generic parameters

2016-07-08 Thread John McCall via swift-dev
> On Jul 7, 2016, at 8:17 PM, Joe Groff wrote: >> On Jul 7, 2016, at 5:26 PM, John McCall wrote: >> >> Suppose we are calling a function that is generic over T, where T: >> AnyObject. This comes up when e.g. calling an initializer for an ObjC >> generic class. >> >> Today we allow conversion

[swift-dev] Type inference of functions with more than one statement

2016-07-08 Thread Ross LeBeau via swift-dev
It seems that the compiler fails to infer the type of an anonymous function if the function contains more than one statement. For example, this works: let a = [[1,2],[3],[4,5,6]] var b: [Int] b = a.flatMap { elem in return elem } But this fails with an error "cannot convert return expression of