On Thu, 08 Jan 2015 23:06:38 +0000 "Nordlöw" via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> On Thursday, 8 January 2015 at 16:11:07 UTC, ketmar via > Digitalmars-d-learn wrote: > > how can it? compiler doesn't know what the code is supposed to > > do. if > > compilers will know such things someday, we can stop writing > > programs > > altogether, as compilers will be able to write any program for > > us. ;-) > > Correction: > > I thought it would be nice if the compiler explained to me that > > key in aa ? aa[key] > > is a sub-optimal performance-wise. although it's right in most cases, it's still implying that compiler is able to understand the code behind `in` and `[key]`, as they aren't built into the compiler, but rather coded in druntime. producing warning on such code can create wrong impression about compiler code analysing abilities. this time i think that it's a work for a linter, 'cause there is nothing wrong with the code, it's just a questionable style. so let linter question it. ;-)
signature.asc
Description: PGP signature