Skip to content

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Nov 19, 2015

https://issues.dlang.org/show_bug.cgi?id=15352

  1. match() function relies on Expression.equals(). Add FuncExp.equals for the identity comparison of two FuncExps.
  2. When a FuncLiteralDeclaration is listed directly in template arguments, it needs to be converted to FuncExp to be able to match TemplateValueParameter.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
15352 template arguments matching error with delegates

Tuple u2 = isTuple(o2);
enum debugPrint = 0;

auto t1 = isType(o1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only tangentially related, but at some point it would make sense to optimize match. It shows up on the profile for building some template-heavy programs. Specifically, some of the isXXX checks can be done later, and there might be something to gain by directly comparing the kind members (but obviously not for the expression vs. symbol case).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I opened a new PR #5276 to do the small optimization. Then, I'll remove the match() changes from this PR.

1. `match()` function relies on `Expression.equals()`. Add `FuncExp.equals` for the identity comparison of two `FuncExp`s.

2. When a `FuncLiteralDeclaration` is listed directly in template arguments, it needs to be converted to `FuncExp` to be able to match `TemplateValueParameter`.
@WalterBright
Copy link
Member

Auto-merge toggled on

WalterBright added a commit that referenced this pull request Nov 28, 2015
Issue 15352 - template arguments matching error with delegates
@WalterBright WalterBright merged commit a498e67 into dlang:master Nov 28, 2015
@9rnsr 9rnsr deleted the fix15352 branch November 30, 2015 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants