Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected 'undefined identifier' error when type comparing #17907

Open
dlangBugzillaToGithub opened this issue May 18, 2019 · 10 comments
Open

Expected 'undefined identifier' error when type comparing #17907

dlangBugzillaToGithub opened this issue May 18, 2019 · 10 comments

Comments

@dlangBugzillaToGithub
Copy link

SrMordred reported this on 2019-05-18T03:10:09Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=19882

CC List

  • ag0aep6g
  • kinke

Description

void main()
{
    static if( is(undefined_id == int) ) pragma(msg, "OK");
    	//compiles
        //oops

    //static if( is(int == undefined_id ) ) pragma(msg, "OK"); 
        //Error: undefined identifier undefined_type 
        //as expected
}
@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-05-18T18:30:08Z

@kubo39 created dlang/dmd pull request #9818 "Fix Issue 19882 - Expected 'undefined identifier' error when type" fixing this issue:

- Fix Issue 19882 - Expected 'undefined identifier' error when type
  comparing

https://github.com/dlang/dmd/pull/9818

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-05-19T03:30:14Z

dlang/dmd pull request #9818 "Fix Issue 19882 - Expected 'undefined identifier' error when type" was merged into stable:

- f2397a8363ff77870f5afe943c420aa577fe634d by Hiroki Noda:
  Fix Issue 19882 - Expected 'undefined identifier' error when type
  comparing
  
  Allow to compile when tspec is an undefined identifier.

https://github.com/dlang/dmd/pull/9818

@dlangBugzillaToGithub
Copy link
Author

ag0aep6g commented on 2019-05-19T11:18:01Z

(In reply to Dlang Bot from comment #2)
> dlang/dmd pull request #9818 "Fix Issue 19882 - Expected 'undefined
> identifier' error when type" was merged into stable:

For the record, the merged fix does the opposite of what this issue called for originally. DMD now also accepts `is(int == undefined_id)`.

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-05-26T00:14:47Z

dlang/dmd pull request #9887 "Revert "Fix Issue 19882 - Expected 'undefined identifier' error when …" was merged into stable:

- ead67ea78be202c4aab2aeafa5cf0ed5a409b112 by Martin Kinkelin:
  Revert "Fix Issue 19882 - Expected 'undefined identifier' error when type"
  
  This reverts commit f2397a8363ff77870f5afe943c420aa577fe634d.

https://github.com/dlang/dmd/pull/9887

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-05-26T06:31:34Z

@thewilsonator updated dlang/dmd pull request #9891 "Fix issue 19893" fixing this issue:

- Fix Issue 19882 - Expected 'undefined identifier' error when type
  comparing
  
  Allow to compile when tspec is an undefined identifier.

- Merge pull request #9818 from kubo39/bugfix-19882
  
  Fix Issue 19882 - Expected 'undefined identifier' error when type
  merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>

https://github.com/dlang/dmd/pull/9891

@dlangBugzillaToGithub
Copy link
Author

patric.dexheimer commented on 2019-05-26T15:15:06Z

"DMD now also accepts `is(int == undefined_id)`."
Isn´t this bad?
I got stuck several minutes on this bug because the compiler didn´t tell me that I misspelled an identifier.

@dlangBugzillaToGithub
Copy link
Author

kinke commented on 2019-05-26T15:57:33Z

(In reply to SrMordred from comment #6)
> "DMD now also accepts `is(int == undefined_id)`."
> Isn´t this bad?
> I got stuck several minutes on this bug because the compiler didn´t tell me
> that I misspelled an identifier.

Me too, that's why I reverted the 'fix' and reopened this issue.

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-06-03T02:50:42Z

@SSoulaimane updated dlang/dmd pull request #9946 "fix issue 18784 - cpp constructor returns void on Posix" fixing this issue:

- Fix Issue 19882 - Expected 'undefined identifier' error when type
  comparing
  
  Allow to compile when tspec is an undefined identifier.

- Merge pull request #9818 from kubo39/bugfix-19882
  
  Fix Issue 19882 - Expected 'undefined identifier' error when type
  merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>

https://github.com/dlang/dmd/pull/9946

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-06-03T08:52:15Z

@FeepingCreature updated dlang/dmd pull request #9953 "Fix issue 19936: `alias deprecated get this` falsely triggers deprecation on `array ~=`" fixing this issue:

- Fix Issue 19882 - Expected 'undefined identifier' error when type
  comparing
  
  Allow to compile when tspec is an undefined identifier.

- Merge pull request #9818 from kubo39/bugfix-19882
  
  Fix Issue 19882 - Expected 'undefined identifier' error when type
  merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>

https://github.com/dlang/dmd/pull/9953

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 2019-06-03T13:52:52Z

@wilzbach created dlang/dmd pull request #9956 "Merge stable -> master" fixing this issue:

- Fix Issue 19882 - Expected 'undefined identifier' error when type
  comparing
  
  Allow to compile when tspec is an undefined identifier.

- Merge pull request #9818 from kubo39/bugfix-19882
  
  Fix Issue 19882 - Expected 'undefined identifier' error when type
  merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>

https://github.com/dlang/dmd/pull/9956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant