Bug 14564 – [REG2.067] dmd -property -unittest combination causes compiler error

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-05-10T04:38:00Z
Last change time
2015-08-25T09:44:09Z
Keywords
pull
Assigned to
ag0aep6g
Creator
ljdelight

Comments

Comment #0 by ljdelight — 2015-05-10T04:38:14Z
I see the below errors when compiling a simple file using -property -unittest argument combination. Using either one individually creates a functional binary. A simple main.d: import std.stdio; void main() { writeln("Hello world"); } >dmd -property -unittest ./main.d /usr/include/dmd/phobos/std/uni.d(5736): Error: not a property c.isWhite /usr/include/dmd/phobos/std/uni.d(5738): Error: not a property a.map!(toLower) /usr/include/dmd/phobos/std/uni.d(5738): Error: not a property map(a).filter!(pred) /usr/include/dmd/phobos/std/uni.d(5739): Error: not a property b.map!(toLower) /usr/include/dmd/phobos/std/uni.d(5739): Error: not a property map(b).filter!(pred) /usr/include/dmd/phobos/std/uni.d(6028): Error: template instance std.uni.comparePropertyName!(char, char) error instantiating /usr/include/dmd/phobos/std/algorithm/searching.d(1494): instantiated from here: __lambda2!string /usr/include/dmd/phobos/std/uni.d(6028): instantiated from here: find!((x) => comparePropertyName(x, name) == 0, string[]) /usr/include/dmd/phobos/std/uni.d(6213): instantiated from here: isPrettyPropertyName!char /usr/include/dmd/phobos/std/uni.d(5897): Error: template std.uni.findUnicodeSet!(tab, char).findUnicodeSet.SortedRange!(MapResult!(unaryFun, immutable(UnicodeProperty)[]), __lambda2).SortedRange.lowerBound cannot deduce function from argument types !()(const(char[])), candidates are: /usr/include/dmd/phobos/std/range/package.d(6942): std.uni.findUnicodeSet!(tab, char).findUnicodeSet.SortedRange!(MapResult!(unaryFun, immutable(UnicodeProperty)[]), __lambda2).SortedRange.lowerBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value) if (isTwoWayCompatible!(predFun, ElementType!Range, V) && hasSlicing!Range) /usr/include/dmd/phobos/std/uni.d(6035): Error: template instance std.uni.findUnicodeSet!(tab, char) error instantiating /usr/include/dmd/phobos/std/uni.d(6214): instantiated from here: findSetName!(tab, char) /usr/include/dmd/phobos/std/uni.d(5897): Error: template std.uni.findUnicodeSet!(tab, char).findUnicodeSet.SortedRange!(MapResult!(unaryFun, immutable(UnicodeProperty)[]), __lambda2).SortedRange.lowerBound cannot deduce function from argument types !()(const(char[])), candidates are: /usr/include/dmd/phobos/std/range/package.d(6942): std.uni.findUnicodeSet!(tab, char).findUnicodeSet.SortedRange!(MapResult!(unaryFun, immutable(UnicodeProperty)[]), __lambda2).SortedRange.lowerBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value) if (isTwoWayCompatible!(predFun, ElementType!Range, V) && hasSlicing!Range) /usr/include/dmd/phobos/std/uni.d(6035): Error: template instance std.uni.findUnicodeSet!(tab, char) error instantiating /usr/include/dmd/phobos/std/uni.d(6214): instantiated from here: findSetName!(tab, char) /usr/include/dmd/phobos/std/uni.d(5897): Error: template std.uni.findUnicodeSet!(tab, char).findUnicodeSet.SortedRange!(MapResult!(unaryFun, immutable(UnicodeProperty)[]), __lambda2).SortedRange.lowerBound cannot deduce function from argument types !()(const(char[])), candidates are: /usr/include/dmd/phobos/std/range/package.d(6942): std.uni.findUnicodeSet!(tab, char).findUnicodeSet.SortedRange!(MapResult!(unaryFun, immutable(UnicodeProperty)[]), __lambda2).SortedRange.lowerBound(SearchPolicy sp = SearchPolicy.binarySearch, V)(V value) if (isTwoWayCompatible!(predFun, ElementType!Range, V) && hasSlicing!Range) /usr/include/dmd/phobos/std/uni.d(6035): Error: template instance std.uni.findUnicodeSet!(tab, char) error instantiating /usr/include/dmd/phobos/std/uni.d(6215): instantiated from here: findSetName!(tab, char) /usr/include/dmd/phobos/std/uni.d(6114): called from here: findAny("Cyrillic") /usr/include/dmd/phobos/std/uni.d(6117): Error: static assert "No unicode set by name Cyrillic was found." /usr/include/dmd/phobos/std/uni.d(2236): instantiated from here: opDispatch!"Cyrillic" /usr/include/dmd/phobos/std/uni.d(1853): instantiated from here: InversionList!(GcPolicy)
Comment #1 by ljdelight — 2015-05-10T04:42:39Z
I forgot to note that the arg combination compiles using the previous version of dmd v2.066.1, and failure in v2.067.1.
Comment #2 by ag0aep6g — 2015-05-10T10:01:58Z
(In reply to Lucas Burson from comment #1) > I forgot to note that the arg combination compiles using the previous > version of dmd v2.066.1, and failure in v2.067.1. Making this a regression.
Comment #3 by dlang-bugzilla — 2015-05-13T21:13:14Z
-property is going away, but let's see what the maintainers say. Introduced in https://github.com/D-Programming-Language/phobos/pull/2723
Comment #4 by ilyayaroshenko — 2015-05-14T01:15:46Z
(In reply to Vladimir Panteleev from comment #3) > -property is going away, but let's see what the maintainers say. > > Introduced in https://github.com/D-Programming-Language/phobos/pull/2723 Also introduced in std.uni (c.isWhite): @trusted int comparePropertyName(Char1, Char2)(const(Char1)[] a, const(Char2)[] b) { import std.ascii : toLower; import std.algorithm : cmp, map, filter; static bool pred(dchar c) {return !c.isWhite && c != '-' && c != '_';} return cmp( a.map!toLower.filter!pred, b.map!toLower.filter!pred); }
Comment #5 by dlang-bugzilla — 2015-05-14T01:17:55Z
(In reply to Илья Ярошенко from comment #4) > Also introduced in Please file that as a separate bug.
Comment #6 by ilyayaroshenko — 2015-05-14T01:30:38Z
I think it is the same bug because the error log by Lucas is about std.uni. If it would be decided that property syntax in Phobos should be fixed I'll fix both bugs.
Comment #7 by issues.dlang — 2015-06-28T00:19:10Z
We should just change it so that -property does nothing (except maybe print that it's a defunct flag) so that no one's build process gets broken by its removal and so that we no longer have to care about it working. We _were_ building Phobos with it to ensure that we weren't breaking anyone's code by writing code in templated functions which didn't work with -property, but clearly, we're not doing that anymore. I think that we either need to be building with -property to ensure that we're not breaking folks code (and thus need to fix this regression), or we need to fix it so that -property does nothing so that there are no compilation errors related to -property.
Comment #8 by bugzilla — 2015-07-11T23:37:39Z
(In reply to Vladimir Panteleev from comment #3) > -property is going away, but let's see what the maintainers say. > > Introduced in https://github.com/D-Programming-Language/phobos/pull/2723 Any idea which of those 196 lines produced the regression?
Comment #9 by ilyayaroshenko — 2015-07-12T03:45:43Z
(In reply to Walter Bright from comment #8) > (In reply to Vladimir Panteleev from comment #3) > > -property is going away, but let's see what the maintainers say. > > > > Introduced in https://github.com/D-Programming-Language/phobos/pull/2723 > > Any idea which of those 196 lines produced the regression? All lines with call `_ctfeSkipOp` or `_ctfeSkipInteger`.
Comment #10 by bugzilla — 2015-07-21T23:35:32Z
(In reply to Илья Ярошенко from comment #9) > (In reply to Walter Bright from comment #8) > > Any idea which of those 196 lines produced the regression? > > All lines with call `_ctfeSkipOp` or `_ctfeSkipInteger`. So, the whole PR? Should we just revert it?
Comment #11 by ilyayaroshenko — 2015-07-22T06:30:15Z
(In reply to Walter Bright from comment #10) > (In reply to Илья Ярошенко from comment #9) > > (In reply to Walter Bright from comment #8) > > > Any idea which of those 196 lines produced the regression? > > > > All lines with call `_ctfeSkipOp` or `_ctfeSkipInteger`. > > So, the whole PR? Should we just revert it? Not only this PR! You need to revert half of Phobos if you want to fix this bug by reverting something. For example, this is line in std.uni: static bool pred(dchar c) {return !c.isWhite && c != '-' && c != '_';} The error (the first in this bug report) occurs because c.isWhite has not braces, not because my PR. We need make the choice: 1. Remove -property option from compiler OR 2. Add the -property option to the GitHub testing engine and fix ALL Phobos.
Comment #12 by issues.dlang — 2015-07-22T20:15:58Z
(In reply to Илья Ярошенко from comment #11) > We need make the choice: > 1. Remove -property option from compiler > OR > 2. Add the -property option to the GitHub testing engine and fix ALL Phobos. Exactly. And given that even if we want some type of property enforcement, the -property flag is enforcing something that we definitely _don't_ want at this point (that non-@property functions be called with parens), I think that we'd be better off to just remove -property. And presumably, that would mean making it do nothing to begin with rather than simply removing it, but we clearly don't want it, and it seems rather silly to be making a bunch of changes to Phobos at this point to support it (though arguably, whatever PR that removed the -property flag from the Phobos build shouldn't have been pulled as long as -property was still in the compiler, but it's a bit late for that now). So, personally, I think that the clear choice is to make -property do nothing (except maybe print out a warning about how it now does nothing), but I don't know how much work that would be. Regardless, we have to get rid of it at some point, and if we don't do it now, we need to start building Phobos with -property, and make all of the changes associated with that.
Comment #13 by ag0aep6g — 2015-07-30T19:11:29Z
(In reply to Jonathan M Davis from comment #12) > So, personally, I think that the clear choice is to make -property do > nothing (except maybe print out a warning about how it now does nothing), > but I don't know how much work that would be. PR for that: https://github.com/D-Programming-Language/dmd/pull/4850
Comment #14 by ag0aep6g — 2015-08-05T20:02:45Z
Comment #15 by github-bugzilla — 2015-08-25T09:44:09Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1e391e7b7a7a5d088811a7d5b145c783dfb4e356 make -property do nothing fixes issue 14564 - [REG2.067] dmd -property -unittest combination causes compiler error Regarding the removed tests: Issue 8629 occurred with other errors than property errors, too. It would be possible to replace the property error with another one in the test. But Martin Nowak says: "Just remove the test." The test for issue 9241 was about the exact error message for when a non-property is called without parentheses. That's allowed now, even with -property. Removing the test. https://github.com/D-Programming-Language/dmd/commit/05d132b4c15048fb988f6f498ce5ec4bfddb0512 Merge pull request #4862 from aG0aep6G/property-switch-2 issue 14564 - [REG2.067] dmd -property -unittest combination causes compiler error