Skip to content

Commit d26760e

Browse files
authored
Merge pull request #42010 from nkcsgexi/90210674
2 parents 05235ed + 121f39c commit d26760e

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

include/swift/AST/Types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2088,7 +2088,7 @@ class ParameterTypeFlags {
20882088
return value.toRaw() != other.value.toRaw();
20892089
}
20902090

2091-
uint8_t toRaw() const { return value.toRaw(); }
2091+
uint16_t toRaw() const { return value.toRaw(); }
20922092
};
20932093

20942094
class YieldTypeFlags {

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@ static ConstraintSystem::TypeMatchResult matchCallArguments(
19661966
locator->getAnchor().isExpr(ExprKind::UnresolvedMemberChainResult)) {
19671967
locator =
19681968
cs.getConstraintLocator(cast<UnresolvedMemberChainResultExpr>(
1969-
locator->getAnchor().get<Expr*>())->getChainBase());
1969+
locator->getAnchor().get<Expr*>())->getSubExpr());
19701970
}
19711971
cs.recordFix(NotCompileTimeConst::create(cs, paramTy, locator));
19721972
}

test/Sema/const_enum_elements2.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
enum E {
4+
case a
5+
case b(Int)
6+
7+
var c: E { .b(42) }
8+
}
9+
10+
func test(_: _const E) {}
11+
12+
test(.a.c) // expected-error {{expect a compile-time constant literal}}

0 commit comments

Comments
 (0)