Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lldb/source/Expression/Materializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,7 @@ class EntityVariable : public Materializer::Entity {
const bool is_dynamic_class_type =
m_is_generic &&
(valobj_type.GetTypeClass() == lldb::eTypeClassClass);
const bool scalar_is_load_address = m_is_generic; // this is the only
// time we're dealing
// with dynamic values

const bool scalar_is_load_address = false;
// if the dynamic type is a class, bypass the GetAddressOf() optimization
// as it doesn't do the right thing
lldb::addr_t addr_of_valobj =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def test_extension_weak_self (self):
self.do_self_test("Break here for weak self")

@swiftTest
@expectedFailureAll(oslist=["linux"], bugnumber="rdar://31822722")
def test_extension_self (self):
"""Test that we can reconstruct self in method of a class constrained protocol."""
self.build()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SWIFT_SOURCES := main.swift

include Makefile.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *


class TestSwiftProtocolExtensionSelf(TestBase):

mydir = TestBase.compute_mydir(__file__)

@swiftTest
def test(self):
"""Test that the generic self in a protocol extension works in the expression evaluator.
"""
self.build()

lldbutil.run_to_source_breakpoint(self, "break here",
lldb.SBFileSpec('main.swift'))
self.expect("e f", substrs=[' = 12345'])
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class C : CP {
let f: Int = 12345
}

protocol CP : class {}

extension CP {
func foo() {
print(self) // break here
}
}

C().foo()