[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-05-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Kenji Hara k.hara...@gmail.com ---
(In reply to Kenji Hara from comment #7)
 Will be fixed by:
 https://github.com/D-Programming-Language/dmd/pull/4691

It was merged:
https://github.com/D-Programming-Language/dmd/commit/185779938ac17bfe412f390b4971daeb07d057bd

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-05-30 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

--- Comment #7 from Kenji Hara k.hara...@gmail.com ---
(In reply to Igor Stepanov from comment #6)
 This issue is not fully solved.
 There is simpler example:
 -
 struct FooBar
 {
 int a;
 int b;
 }
 
 void test14093()
 {
 FooBar foo;
 auto obj = cast(Object)foo; //e2ir: cannot cast foo of type FooBar to
 type object.Object
 }
 -

Will be fixed by:
https://github.com/D-Programming-Language/dmd/pull/4691

 Moreover, I think, this issue is solved incorrectly: alias this mechanism
 should reject `cast(Object)(point._tupleAliasThis_)` variant and continue
 process the root casting cast(Object)point excluding alias this.
 And result error message should be 
 Error: cannot cast expression point of type Tuple!(int, x, int, y) to
 object.Object.
 We are interested in subtyping (alias this, or inheritance) only when it can
 done its work (casting, .member ...).

It's rather diagnostic issue. I opened a new minor issue 14632.

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-05-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

Igor Stepanov wazar.leoll...@yahoo.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||wazar.leoll...@yahoo.com
 Resolution|FIXED   |---

--- Comment #6 from Igor Stepanov wazar.leoll...@yahoo.com ---
This issue is not fully solved.
There is simpler example:
-
struct FooBar
{
int a;
int b;
}

void test14093()
{
FooBar foo;
auto obj = cast(Object)foo; //e2ir: cannot cast foo of type FooBar to type
object.Object
}
-
Moreover, I think, this issue is solved incorrectly: alias this mechanism
should reject `cast(Object)(point._tupleAliasThis_)` variant and continue
process the root casting cast(Object)point excluding alias this.
And result error message should be 
Error: cannot cast expression point of type Tuple!(int, x, int, y) to
object.Object.
We are interested in subtyping (alias this, or inheritance) only when it can
done its work (casting, .member ...).

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-02-21 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

--- Comment #5 from github-bugzi...@puremagic.com ---
Commits pushed to https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1d0268e92e83ec62f0daa548e39c749902e7eb54
fix Issue 14093 - __traits(compiles, cast(Object)(tuple)) is true even if it
doesn't compile.

https://github.com/D-Programming-Language/dmd/commit/132d5f29732301250ea1a1684b858cf6f555
Merge pull request #4395 from 9rnsr/fix14093

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-02-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1d0268e92e83ec62f0daa548e39c749902e7eb54
fix Issue 14093 - __traits(compiles, cast(Object)(tuple)) is true even if it
doesn't compile.

Move invalid cast check into Expression::castTo().

https://github.com/D-Programming-Language/dmd/commit/132d5f29732301250ea1a1684b858cf6f555
Merge pull request #4395 from 9rnsr/fix14093

[REG2.065] Issue 14093 - __traits(compiles, cast(Object)(tuple)) is true even
if it doesn't compile

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-02-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-02-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||pull, rejects-valid

--- Comment #3 from Kenji Hara k.hara...@gmail.com ---
https://github.com/D-Programming-Language/dmd/pull/4395

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-02-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com

--- Comment #2 from Walter Bright bugzi...@digitalmars.com ---
The error:

foo2.d(8): Error: e2ir: cannot cast __tup1850.__expand_field_0 of type int to
type object.Object
foo2.d(8): Error: e2ir: cannot cast __tup1850.__expand_field_1 of type int to
type object.Object

is coming from the glue layer. The __traits(compiles, ) does not get that far.
The error check needs to be moved up into the front end to fix it.

--


[Issue 14093] [REG2.065] __traits(compiles, cast(Object)(tuple)) is true even if it doesn't compile.

2015-01-31 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14093

sinkuup...@gmail.com changed:

   What|Removed |Added

 CC||sinkuup...@gmail.com
   Hardware|x86_64  |All
Summary|__traits(compiles,  |[REG2.065]
   |cast(Object)(tuple)) is |__traits(compiles,
   |true even if it doesn't |cast(Object)(tuple)) is
   |compile.|true even if it doesn't
   ||compile.
 OS|Linux   |All

--- Comment #1 from sinkuup...@gmail.com ---
Introduced in https://github.com/D-Programming-Language/dmd/pull/3009

(In reply to Pierre krafft from comment #0)
 The code compiles if I run it in DPaste version DMD 2.x Git (cfb5842b49).

commit cfb5842b49 seems to be DMD 2.063.x.

--