Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0c0f748

Browse filesBrowse files
committed
Go: Extract objects for aliases
1 parent eb2f198 commit 0c0f748
Copy full SHA for 0c0f748

File tree

1 file changed

+10
-0
lines changed
Filter options

1 file changed

+10
-0
lines changed

‎go/extractor/extractor.go

Copy file name to clipboardExpand all lines: go/extractor/extractor.go
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,16 @@ func extractType(tw *trap.Writer, tp types.Type) trap.Label {
16511651
kind = dbscheme.TypeAlias.Index()
16521652
dbscheme.TypeNameTable.Emit(tw, lbl, tp.Obj().Name())
16531653
dbscheme.AliasRhsTable.Emit(tw, lbl, extractType(tw, tp.Rhs()))
1654+
1655+
entitylbl, exists := tw.Labeler.LookupObjectID(tp.Obj(), lbl)
1656+
if entitylbl == trap.InvalidLabel {
1657+
log.Printf("Omitting type-object binding for unknown object %v.\n", tp.Obj())
1658+
} else {
1659+
if !exists {
1660+
extractObject(tw, tp.Obj(), entitylbl)
1661+
}
1662+
dbscheme.TypeObjectTable.Emit(tw, lbl, entitylbl)
1663+
}
16541664
default:
16551665
log.Fatalf("unexpected type %T", tp)
16561666
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.