diff --git a/semaphoreci.sh b/semaphoreci.sh index 50c94948148d..a209005f86eb 100755 --- a/semaphoreci.sh +++ b/semaphoreci.sh @@ -19,8 +19,7 @@ export OS_NAME=linux export FULL_BUILD="${PULL_REQUEST_NUMBER+false}" # SemaphoreCI doesn't provide a convenient way to the base branch (e.g. master or stable) if [ -n "${PULL_REQUEST_NUMBER:-}" ]; then - # detect master/stable without querying the rate-limited API - BRANCH="$(git describe --all | sed -E "s/.*\/([^-/]*)-.*/\1/")" + BRANCH=$((curl -fsSL https://api.github.com/repos/dlang/dmd/pulls/$PULL_REQUEST_NUMBER || echo) | jq -r '.base.ref') # check if the detected branch actually exists and fallback to master if ! git ls-remote --exit-code --heads https://github.com/dlang/dmd.git "$BRANCH" > /dev/null ; then echo "Invalid branch detected: ${BRANCH} - falling back to master" diff --git a/src/dmd/traits.d b/src/dmd/traits.d index 60b483963748..e796a035ef6c 100644 --- a/src/dmd/traits.d +++ b/src/dmd/traits.d @@ -1006,7 +1006,7 @@ extern (C++) Expression semanticTraits(TraitsExp e, Scope* sc) // if the parent is an interface declaration // we must check for functions with the same signature // in different inherited interfaces - if (sym.isInterfaceDeclaration()) + if (sym && sym.isInterfaceDeclaration()) insertInterfaceInheritedFunction(fd, e); else exps.push(e); diff --git a/test/compilable/traits.d b/test/compilable/traits.d new file mode 100644 index 000000000000..5dc90fb716fc --- /dev/null +++ b/test/compilable/traits.d @@ -0,0 +1,13 @@ +// This file is intended to contain all compilable traits-related tests in an +// effort to keep the number of files in the `compilable` folder to a minimum. + +// https://issues.dlang.org/show_bug.cgi?id=19152 + +class C19152 +{ + int OnExecute() + { + auto name = __traits(getOverloads, this, "OnExecute").stringof; + return 0; + } +}