Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Issue 1983 - Big Hole in Const System #71

Closed
wants to merge 14 commits into from

2 participants

@9rnsr
Collaborator

http://d.puremagic.com/issues/show_bug.cgi?id=1983
(This request is detab-ed version of #70)

This changes onto #72 . See it before merging.

Points of fixes:

  • DotVarExp resolve overloads by e1 type modifiers. When there is one exact match, it makes 'exact type'. Two or more matches exists but one match is better than others, make 'better type'. When matches are ambiguous (There are exact/const conversion matches each other), make 'ambiguous type'. Others make 'no match'.
  • Against 'ambiguous type', is(typeof(...)) idiom is still valid. But ambiguous type itself makes compile error. Implicit/explicit casting against ambiguous type expression resolves its overloads.
  • Keep symbols resolved overloads (by __traits(getOverloads, ...) and extract with index) through template alias/tuple parameters.

Supplemental changes of Phobos:
See D-Programming-Language/phobos#78

Thanks.

@9rnsr 9rnsr closed this
@9rnsr 9rnsr reopened this
@9rnsr
Collaborator

Improve changes, and phobos build & dmd/phobos test suites are now ok.

@Trass3r

What if static opCall is used for something other than construction?

Collaborator

If you use call expression with type (T(...)), and the T has both constructor and static opCall, then constructor is always preferred.
If you want to use static opCall, you should not define any constructors.

Good point. I think having both static opCall and constructors should be a compiler error then.

@9rnsr
Collaborator

I found an issue around ambiguous function type.
I have closed this request temporarily.

@9rnsr 9rnsr closed this
@AlexeyProkhin AlexeyProkhin referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 14, 2011
  1. @9rnsr
  2. @9rnsr
  3. @9rnsr
  4. @9rnsr

    # fix indents.

    9rnsr authored
  5. @9rnsr

    Reduce error message.

    9rnsr authored
  6. @9rnsr
  7. @9rnsr
  8. @9rnsr
  9. @9rnsr

    Add ambiguous type flag.

    9rnsr authored
  10. @9rnsr
  11. @9rnsr
  12. @9rnsr

    Treat ambiguous type somewhere.

    9rnsr authored
    - Ambiguous type inside IsExp is now valid.
    - Ambiguous type inside typeof occurs error.
    - Ambiguous type resolved by implicit/explicit casting.
    - Ambiguous type of DelegateExp/SymOff occurs error.
    - Ambiguous type of ReturnStatement occurs error.
    - Ambiguous type of initializer on AutoDeclaration occurs error.
    - Ambiguous type of foreach aggregator runs inference.
  13. @9rnsr
  14. @9rnsr

    Add test case for issue 1680 - static struct constructor overloaded w…

    9rnsr authored
    …ith method prevents compilation in inner function
Something went wrong with that request. Please try again.