Skip to content

Commit 8dfae16

Browse files
committed
Inheriting constructors should not produce substitutable values.
Issue #272
1 parent 8df7955 commit 8dfae16

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ast.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,13 +3260,13 @@ impl Parse for VOffset {
32603260
#[derive(Clone, Debug, PartialEq, Eq)]
32613261
pub enum CtorDtorName {
32623262
/// "C1", the "complete object constructor"
3263-
CompleteConstructor(Option<TypeHandle>),
3263+
CompleteConstructor(Option<Box<Name>>),
32643264
/// "C2", the "base object constructor"
3265-
BaseConstructor(Option<TypeHandle>),
3265+
BaseConstructor(Option<Box<Name>>),
32663266
/// "C3", the "complete object allocating constructor"
3267-
CompleteAllocatingConstructor(Option<TypeHandle>),
3267+
CompleteAllocatingConstructor(Option<Box<Name>>),
32683268
/// "C4", the "maybe in-charge constructor"
3269-
MaybeInChargeConstructor(Option<TypeHandle>),
3269+
MaybeInChargeConstructor(Option<Box<Name>>),
32703270
/// "D0", the "deleting destructor"
32713271
DeletingDestructor,
32723272
/// "D1", the "complete object destructor"
@@ -3278,7 +3278,7 @@ pub enum CtorDtorName {
32783278
}
32793279

32803280
impl CtorDtorName {
3281-
fn inheriting_mut(&mut self) -> &mut Option<TypeHandle> {
3281+
fn inheriting_mut(&mut self) -> &mut Option<Box<Name>> {
32823282
match self {
32833283
CtorDtorName::CompleteConstructor(ref mut inheriting)
32843284
| CtorDtorName::BaseConstructor(ref mut inheriting)
@@ -3337,8 +3337,8 @@ impl Parse for CtorDtorName {
33373337
}?;
33383338

33393339
if inheriting {
3340-
let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?;
3341-
*ctor_type.inheriting_mut() = Some(ty);
3340+
let (ty, tail) = Name::parse(ctx, subs, tail)?;
3341+
*ctor_type.inheriting_mut() = Some(Box::new(ty));
33423342
Ok((ctor_type, tail))
33433343
} else {
33443344
Ok((ctor_type, tail))

0 commit comments

Comments
 (0)