Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go: extract explicit alias types #18283

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
cf1affc
Go: Update dbscheme for aliases
mbg Aug 16, 2024
f602ba3
Go: Extract type aliases
mbg Aug 16, 2024
7abf9e6
Go: Extract alias names
mbg Aug 16, 2024
17c279b
Go: Fix formatting and documentation of `AliasType`
mbg Aug 16, 2024
14df781
Go: Update `AliasType` to implement `getUnderlyingType`
mbg Aug 19, 2024
81501bd
Go: Extract objects for aliases
mbg Aug 19, 2024
5502e13
Factor out `extractTypeObject`
owen-mc Aug 21, 2024
a0aaba1
Fix alias use in HTML template escaping passthrough
owen-mc Aug 20, 2024
1d39188
Use unique type param names in test
owen-mc Aug 20, 2024
d50a5c8
Fix syntax error in test
owen-mc Aug 21, 2024
56f2228
Improve `AliasType.getUnderlyingType`
owen-mc Aug 21, 2024
807be11
Update labels for alias types
owen-mc Aug 22, 2024
979da03
Add change note
owen-mc Aug 22, 2024
9233a02
Look through aliases in hasOwnField
smowton Aug 26, 2024
d68e176
Implement deep unaliasing, and use it in interface dispatch resolution
smowton Aug 26, 2024
4841200
Transparent aliases: don't look through named types
smowton Aug 28, 2024
cd47680
Transparent aliases: don't write an invalid type to the @types table …
smowton Aug 28, 2024
cf54064
Distinguish types with and without explicit aliases in the type-label…
smowton Aug 28, 2024
eaf65d9
Fix Mongodb additional taint step
smowton Aug 29, 2024
6adde0a
Don't repeat parts of extractType that populate tracking tables
smowton Aug 29, 2024
d23d36d
Fix flow through pointer types related by aliasing
smowton Aug 29, 2024
3ec68f6
Fix missed case
smowton Aug 29, 2024
0a5f217
Improve efficiency of composite-type deep-unalias computation
smowton Aug 30, 2024
f2b3c2f
Make deep-unalias computation even more efficient using unpack routines
smowton Aug 30, 2024
b455091
Only extract transparent-alias versions of types when necessary
smowton Aug 31, 2024
2a6ebca
Fix struct deepUnaliasedType predicate
smowton Sep 1, 2024
546d661
Implement deep-unalias for interface types
smowton Sep 1, 2024
635dd68
Fix TupleType's getDeepUnaliasedType, and make it efficient
smowton Sep 1, 2024
b7a4c85
autoformat and tidy an unnecessary direct db relation use
smowton Sep 1, 2024
f39b9db
Interface unaliasing: don't confuse the empty interface with the type…
smowton Sep 1, 2024
2b6786a
Ensure fields are created for de-aliased struct types
smowton Sep 2, 2024
d3355e3
autoformat
smowton Sep 2, 2024
3406e02
Interface types: distinguish otherwise-identical interfaces with non-…
owen-mc Dec 11, 2024
a4b500c
Upgrade/downgrade scripts
owen-mc Dec 11, 2024
305353e
Accept test changes
owen-mc Dec 13, 2024
3c44685
Test changes to be investigated
owen-mc Dec 13, 2024
187b5ee
Make four predicates private
owen-mc Dec 13, 2024
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

Large diffs are not rendered by default.

552 changes: 552 additions & 0 deletions go/downgrades/20cbf29a08034a40b49ab41c26f37a710de32857/go.dbscheme

Large diffs are not rendered by default.

555 changes: 555 additions & 0 deletions go/downgrades/20cbf29a08034a40b49ab41c26f37a710de32857/old.dbscheme

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
description: Remove support for type aliases
compatibility: full

alias_rhs.rel: delete
array_length.rel: run explicit_aliases_downgrade.qlo new_array_length
base_type.rel: run explicit_aliases_downgrade.qlo new_base_type
component_types.rel: run explicit_aliases_downgrade.qlo new_component_types
defs.rel: run explicit_aliases_downgrade.qlo new_defs
element_type.rel: run explicit_aliases_downgrade.qlo new_element_type
fieldstructs.rel: run explicit_aliases_downgrade.qlo new_fieldstructs
key_type.rel: run explicit_aliases_downgrade.qlo new_key_type
objects.rel: run explicit_aliases_downgrade.qlo new_objects
objecttypes.rel: run explicit_aliases_downgrade.qlo new_objecttypes
type_objects.rel: run explicit_aliases_downgrade.qlo new_type_objects
type_of.rel: run explicit_aliases_downgrade.qlo new_type_of
typename.rel: run explicit_aliases_downgrade.qlo new_typename
typeparam.rel: run explicit_aliases_downgrade.qlo new_typeparam
types.rel: run explicit_aliases_downgrade.qlo new_types
underlying_type.rel: run explicit_aliases_downgrade.qlo new_underlying_type
uses.rel: run explicit_aliases_downgrade.qlo new_uses
variadic.rel: run explicit_aliases_downgrade.qlo new_variadic
9 changes: 9 additions & 0 deletions go/extractor/dbscheme/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ var NamedType = TypeKind.NewBranch("@namedtype", CompositeType)
// TypeSetLiteral is the type of type set literals
var TypeSetLiteral = TypeKind.NewBranch("@typesetliteraltype", CompositeType)

// TypeAlias is the type of type aliases
var TypeAlias = TypeKind.NewBranch("@typealias", CompositeType)

// PackageType is the type of packages
var PackageType = NewPrimaryKeyType("@package")

Expand Down Expand Up @@ -1142,6 +1145,12 @@ var UnderlyingTypeTable = NewTable("underlying_type",
EntityColumn(TypeType, "tp"),
)

// AliasRhsTable is the table associating type aliases with their RHS.
var AliasRhsTable = NewTable("alias_rhs",
EntityColumn(TypeAlias, "alias").Unique(),
EntityColumn(TypeType, "tp"),
)

// ComponentTypesTable is the table associating composite types with their component types
var ComponentTypesTable = NewTable("component_types",
EntityColumn(CompositeType, "parent"),
Expand Down
Loading
Loading