digitalmars.D - Weird dmd error?
- Andrea Fontana (9/9) Nov 07 2016 --- test.d
- Anonymous (16/24) Nov 07 2016 It looks normal but it's not documented. It's just that the
- Anonymous (12/27) Nov 07 2016 To be clearer, the problem is the same with:
- Andrea Fontana (3/8) Nov 07 2016 But it's not really the same, error in my case is inside druntime.
- Anonymous (3/12) Nov 07 2016 i'm on a 2071.2 frontend now, my comments are based on this.
- Anonymous (2/16) Nov 07 2016 oh no yet another 2.072 regression !
- Andrea Fontana (3/15) Nov 07 2016 2071.2 too. On linux, here :)
- =?UTF-8?Q?Ali_=c3=87ehreli?= (5/13) Nov 07 2016 You're right. It's a bug that module core.sys.posix.sys.types uses
- Andrea Fontana (2/6) Nov 07 2016 https://issues.dlang.org/show_bug.cgi?id=16666
--- test.d void* test (ssize_t ); import core.sys.posix.unistd; --- Try to run: dmd test.d It says: /usr/include/dmd/druntime/import/core/sys/posix/sys/types.d(100): Error: undefined identifier 'c_long'
Nov 07 2016
On Monday, 7 November 2016 at 08:34:55 UTC, Andrea Fontana wrote:--- test.d void* test (ssize_t ); import core.sys.posix.unistd; --- Try to run: dmd test.d It says: /usr/include/dmd/druntime/import/core/sys/posix/sys/types.d(100): Error: undefined identifier 'c_long'It looks normal but it's not documented. It's just that the import is not yet known in the scope. It 's like: void main(string[] args) { writeln(); import std.stdio; } But void main(string[] args) { writeln(); } import std.stdio; works because the symbol lookup succeeds in the parent scope. For your example to work, another semantic pass would necessary.
Nov 07 2016
On Monday, 7 November 2016 at 09:58:08 UTC, Anonymous wrote:On Monday, 7 November 2016 at 08:34:55 UTC, Andrea Fontana wrote:To be clearer, the problem is the same with: void main() { foo; void foo(){} } Exactly the same thing happens. There's already 3 semantic passes. To solve this kind of forward references another semantic pass would be required. But in this case you couldn't determine how many passes would be necessary so there would be a complexity problem in the compiler.--- test.d void* test (ssize_t ); import core.sys.posix.unistd; --- Try to run: dmd test.d It says: /usr/include/dmd/druntime/import/core/sys/posix/sys/types.d(100): Error: undefined identifier 'c_long'It looks normal but it's not documented. It's just that the import is not yet known in the scope.
Nov 07 2016
On Monday, 7 November 2016 at 10:57:49 UTC, Anonymous wrote:Exactly the same thing happens. There's already 3 semantic passes. To solve this kind of forward references another semantic pass would be required. But in this case you couldn't determine how many passes would be necessary so there would be a complexity problem in the compiler.But it's not really the same, error in my case is inside druntime. In your example errors are inside my code.
Nov 07 2016
On Monday, 7 November 2016 at 11:57:48 UTC, Andrea Fontana wrote:On Monday, 7 November 2016 at 10:57:49 UTC, Anonymous wrote:i'm on a 2071.2 frontend now, my comments are based on this. are you on 2072 ?Exactly the same thing happens. There's already 3 semantic passes. To solve this kind of forward references another semantic pass would be required. But in this case you couldn't determine how many passes would be necessary so there would be a complexity problem in the compiler.But it's not really the same, error in my case is inside druntime. In your example errors are inside my code.
Nov 07 2016
On Monday, 7 November 2016 at 12:31:57 UTC, Anonymous wrote:On Monday, 7 November 2016 at 11:57:48 UTC, Andrea Fontana wrote:oh no yet another 2.072 regression !On Monday, 7 November 2016 at 10:57:49 UTC, Anonymous wrote:i'm on a 2071.2 frontend now, my comments are based on this. are you on 2072 ?Exactly the same thing happens. There's already 3 semantic passes. To solve this kind of forward references another semantic pass would be required. But in this case you couldn't determine how many passes would be necessary so there would be a complexity problem in the compiler.But it's not really the same, error in my case is inside druntime. In your example errors are inside my code.
Nov 07 2016
On Monday, 7 November 2016 at 12:31:57 UTC, Anonymous wrote:On Monday, 7 November 2016 at 11:57:48 UTC, Andrea Fontana wrote:2071.2 too. On linux, here :) AndreaOn Monday, 7 November 2016 at 10:57:49 UTC, Anonymous wrote:Exactly the same thing happens. There's already 3 semantic passes. To solve this kind of forward references another semantic pass would be required. But in this case you couldn't determine how many passes would be necessary so there would be a complexity problem in the compiler.But it's not really the same, error in my case is inside druntime. In your example errors are inside my code.
Nov 07 2016
On 11/07/2016 03:57 AM, Andrea Fontana wrote:On Monday, 7 November 2016 at 10:57:49 UTC, Anonymous wrote:You're right. It's a bug that module core.sys.posix.sys.types uses c_long without importing its definition presumably from module core.stdc.config. AliExactly the same thing happens. There's already 3 semantic passes. To solve this kind of forward references another semantic pass would be required. But in this case you couldn't determine how many passes would be necessary so there would be a complexity problem in the compiler.But it's not really the same, error in my case is inside druntime. In your example errors are inside my code.
Nov 07 2016
On Monday, 7 November 2016 at 12:56:06 UTC, Ali Çehreli wrote:You're right. It's a bug that module core.sys.posix.sys.types uses c_long without importing its definition presumably from module core.stdc.config. Alihttps://issues.dlang.org/show_bug.cgi?id=16666
Nov 07 2016