Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues 19655, 19656, 19657, 19746 & 19750 (#9471)
Fix issues 19655, 19656, 19657, 19746 & 19750 merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
- Loading branch information
Showing
6 changed files
with
276 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env bash | ||
|
||
TEST_DIR=${OUTPUT_BASE} | ||
|
||
mkdir -p ${TEST_DIR} | ||
|
||
cat >${TEST_DIR}${SEP}test19656.d <<EOF | ||
import test19656a; | ||
import test19656c: Thud; | ||
class Foo | ||
{ | ||
Foo[Foo] _map; | ||
void func (Thud ) { } | ||
void thunk () { } | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19656b.d <<EOF | ||
import test19656; | ||
class Bar { } | ||
class Qux(T): Foo | ||
{ | ||
override void thunk() { } | ||
} | ||
class Fred | ||
{ | ||
Qux!Bar _q; | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19656c.d <<EOF | ||
import test19656b; | ||
class Thud { } | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19656a.d <<EOF | ||
import test19656; | ||
class Corge: Foo { } | ||
EOF | ||
|
||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}${TEST_NAME}.d | ||
rm -f ${TEST_DIR}${SEP}${TEST_NAME}${OBJ} ${TEST_DIR}${SEP}${TEST_NAME}*.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#! /usr/bin/env bash | ||
|
||
TEST_DIR=${OUTPUT_BASE} | ||
|
||
mkdir -p ${TEST_DIR} | ||
|
||
cat >${TEST_DIR}${SEP}test19657a.d <<EOF | ||
import test19657c; | ||
import test19657e: Bar; | ||
class Foo { | ||
int[Foo] _map; | ||
bool func (Foo rhs, Bar bee) { return true; } | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19657b.d <<EOF | ||
import test19657g; | ||
import test19657a; | ||
import test19657e; | ||
class Frop: Seq { | ||
override bool func(Foo rhs, Bar bee) { return false; } | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19657c.d <<EOF | ||
import test19657a; | ||
class Pol: Foo {} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19657d.d <<EOF | ||
import test19657a; | ||
class Trump: Foo {} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19657e.d <<EOF | ||
import test19657f; | ||
class Bar { } | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19657f.d <<EOF | ||
class Baz { | ||
import test19657d; | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19657g.d <<EOF | ||
import test19657d; | ||
class Seq: Trump {} | ||
EOF | ||
|
||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} \ | ||
${TEST_DIR}${SEP}test19657a.d ${TEST_DIR}${SEP}test19657b.d \ | ||
${TEST_DIR}${SEP}test19657c.d ${TEST_DIR}${SEP}test19657d.d \ | ||
${TEST_DIR}${SEP}test19657e.d ${TEST_DIR}${SEP}test19657f.d \ | ||
${TEST_DIR}${SEP}test19657g.d | ||
|
||
rm -f ${TEST_DIR}${SEP}${TEST_NAME}${OBJ} ${TEST_DIR}${SEP}${TEST_NAME}*.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#! /usr/bin/env bash | ||
|
||
TEST_DIR=${OUTPUT_BASE} | ||
|
||
mkdir -p ${TEST_DIR} | ||
|
||
cat >${TEST_DIR}${SEP}test19746.d <<EOF | ||
import test19746c; | ||
import test19746b: Frop; | ||
template Base(T) | ||
{ | ||
static if (is(T == super)) alias Base = Object; | ||
} | ||
class Foo | ||
{ | ||
class Nested: Base!Foo { } | ||
void func(Frop) { } | ||
void thunk() { } | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19746a.d <<EOF | ||
import test19746; | ||
class Bar: Foo { } | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19746b.d <<EOF | ||
import test19746d; | ||
class Frop { } | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19746c.d <<EOF | ||
import test19746a; | ||
class Qux: Bar { } | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19746d.d <<EOF | ||
import test19746; | ||
class Baz(T): Foo { } | ||
class Dap(T): Baz!T | ||
{ | ||
override void thunk() {} | ||
} | ||
class Zoo | ||
{ | ||
Dap!int _dap; | ||
} | ||
EOF | ||
|
||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}${TEST_NAME}.d | ||
rm -f ${TEST_DIR}${SEP}${TEST_NAME}${OBJ} ${TEST_DIR}${SEP}${TEST_NAME}*.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#! /usr/bin/env bash | ||
|
||
TEST_DIR=${OUTPUT_BASE} | ||
|
||
mkdir -p ${TEST_DIR} | ||
|
||
cat >${TEST_DIR}${SEP}test19750.d <<EOF | ||
import test19750b; | ||
class Foo { | ||
import test19750a; | ||
void func (Bar ) {} | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19750a.d <<EOF | ||
import test19750c; | ||
class Bar {} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19750b.d <<EOF | ||
import test19750d; | ||
class Frop {} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19750c.d <<EOF | ||
import test19750d; | ||
class Qux: Thud { | ||
override void thunk() {} | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19750d.d <<EOF | ||
import test19750; | ||
class Dap(T) {} | ||
class Thud: Foo { | ||
Dap!int _dap; | ||
void thunk() { } | ||
} | ||
EOF | ||
|
||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}${TEST_NAME}.d | ||
rm -f ${TEST_DIR}${SEP}${TEST_NAME}${OBJ} ${TEST_DIR}${SEP}${TEST_NAME}*.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#! /usr/bin/env bash | ||
|
||
TEST_DIR=${OUTPUT_BASE} | ||
|
||
mkdir -p ${TEST_DIR} | ||
|
||
cat >${TEST_DIR}${SEP}test19655a.d <<EOF | ||
import test19655g; | ||
class Corge | ||
{ } | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19655b.d <<EOF | ||
import test19655c; | ||
import test19655d; | ||
class Garply: Grault | ||
{ } | ||
void main() | ||
{ | ||
(new Garply).func; | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19655c.d <<EOF | ||
import test19655f; | ||
import test19655e; | ||
import test19655a: Corge; | ||
class Foo | ||
{ | ||
int[Foo] map; | ||
void fun0(Corge) { } | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19655d.d <<EOF | ||
import test19655f; | ||
import test19655g; | ||
class Grault: Bar | ||
{ | ||
void func() | ||
{ | ||
func2; | ||
} | ||
void func1() | ||
{ | ||
assert(false, "func1 was never called"); | ||
} | ||
void func2() { } | ||
} | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19655e.d <<EOF | ||
import test19655c; | ||
int[Foo] map; | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19655f.d <<EOF | ||
import test19655c; | ||
import test19655g; | ||
EOF | ||
|
||
cat >${TEST_DIR}${SEP}test19655g.d <<EOF | ||
import test19655c; | ||
class Bar: Foo | ||
{ } | ||
EOF | ||
|
||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}test19655a.d | ||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}test19655b.d | ||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}test19655c.d | ||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}test19655d.d | ||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}test19655e.d | ||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}test19655f.d | ||
${DMD} -m${MODEL} -c -I${TEST_DIR} -od${TEST_DIR} ${TEST_DIR}${SEP}test19655g.d | ||
|
||
${DMD} -m${MODEL} -of${TEST_DIR}${SEP}test19655${EXE} ${TEST_DIR}${SEP}test19655a${OBJ} \ | ||
${TEST_DIR}${SEP}test19655b${OBJ} ${TEST_DIR}${SEP}test19655c${OBJ} \ | ||
${TEST_DIR}${SEP}test19655d${OBJ} ${TEST_DIR}${SEP}test19655e${OBJ} \ | ||
${TEST_DIR}${SEP}test19655f${OBJ} ${TEST_DIR}${SEP}test19655g${OBJ} | ||
|
||
${TEST_DIR}${SEP}test19655${EXE} | ||
|
||
rm -f ${TEST_DIR}${SEP}test19655${EXE} ${TEST_DIR}${SEP}test19655*.d \ | ||
${TEST_DIR}${SEP}test19655*${OBJ} |