Off the top of my head I’m not sure if there is a precedent for such a drastic 
change in behaviour between playgrounds and non-playground compilation.
However, allowing type inference in playgrounds while disallowing this 
otherwise could maintain the benefits for educational and experimental 
scenarios while still eliminating the performance and clarity penalties in 
production (compiled) source files.

> Hi all,
> 
> In a discussion about inferring parameter types from default value, Slava 
> brought up some performance problems caused by type inference for stored 
> properties in side types:
> 
> https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170313/033882.html
> 
> Towards the end, the post mentioned that some Swift team members contemplated 
> requiring types for stored properties in type declarations. I think this idea 
> deserves some more attention. Hence this last minute idea-floating.
> 
> In addition to solving a performance headache in implementation, there're 
> always the general benefit of making type declartion more explicit and 
> readable (clarity for reader should out-weigh pleasure of the author). Making 
> the
> language slightly more consistent (we are not inferring types for default 
> parameter values in function anyways).
> 
> The cons for doing this are obvious too: the inference makes the language 
> feels more friendly and is, undoubtedly, a beloved feature for many. This 
> would be a source breaking change.
> 
> Just thought I'd float the idea to gather some quick reaction. What do y'all 
> think?
> 
> Daniel Duan
> 
> 
> 
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
              • ... Matthew Johnson via swift-evolution
              • ... Daniel Duan via swift-evolution
              • ... Matthew Johnson via swift-evolution
              • ... Daniel Duan via swift-evolution
              • ... Sean Heber via swift-evolution
              • ... Charlie Monroe via swift-evolution
              • ... Daniel Duan via swift-evolution
              • ... Matthew Johnson via swift-evolution
              • ... Daniel Duan via swift-evolution
              • ... Matthew Johnson via swift-evolution
  • [swift-evolution] [Pitch] ... Seán Labastille via swift-evolution
  • Re: [swift-evolution] [Pit... Jose Cheyo Jimenez via swift-evolution
  • [swift-evolution] [Pitch] ... David Beck via swift-evolution
  • Re: [swift-evolution] [Pit... Víctor Pimentel Rodríguez via swift-evolution

Reply via email to