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

Go: Support Go 1.23 (Explicit aliases) #17058

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e604749
Go: Use 1.23 in build process
mbg Jul 24, 2024
299b2e4
Go: Use 1.23 in tests
mbg Jul 24, 2024
6b1bd05
Go: Use 1.23 for extractor
mbg Jul 24, 2024
1192564
Go: Update frontend error messages for Go 1.23
mbg Jul 24, 2024
f4b3dfc
Go: Update dbscheme for aliases
mbg Aug 16, 2024
bbe2406
Go: Extract type aliases
mbg Aug 16, 2024
cd7cf4f
Go: Add database upgrade/downgrades for type aliases
mbg Aug 16, 2024
91946de
Go: Extract alias names
mbg Aug 16, 2024
221bab7
Go: Add test for `AliasType` extraction
mbg Aug 16, 2024
47ad284
Go: Fix formatting and documentation of `AliasType`
mbg Aug 16, 2024
90068f6
Go: Update `AliasType` to implement `getUnderlyingType`
mbg Aug 19, 2024
5797dba
Go: Extract objects for aliases
mbg Aug 19, 2024
191f712
Go: Update test for aliases to print immediate RHS and underlying type
mbg Aug 19, 2024
76e27ff
Go: Remove `alias_rhs` table in downgrade script
mbg Aug 19, 2024
77cf0ac
Go: add patch for go 1.23 windows build problem
Aug 21, 2024
f6e577e
Factor out `extractTypeObject`
owen-mc Aug 21, 2024
3a8a7ea
Fix alias use in HTML template escaping passthrough
owen-mc Aug 20, 2024
7589186
Use unique type param names in test
owen-mc Aug 20, 2024
a6557fc
Accept test change related to alias types
owen-mc Aug 20, 2024
9ca7536
Update underlying type of alias
owen-mc Aug 21, 2024
f2695d0
Fix syntax error in test
owen-mc Aug 21, 2024
23d1dfa
Delete more about alias types in downgrade script
owen-mc Aug 21, 2024
bd89eb0
Improve `AliasType.getUnderlyingType`
owen-mc Aug 21, 2024
649bf5a
Improve Aliases test
owen-mc Aug 21, 2024
fe6d364
Update labels for alias types
owen-mc Aug 22, 2024
da12b33
Add change note
owen-mc Aug 22, 2024
e660b85
Update max supported Go version to 1.23
owen-mc Aug 22, 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
Prev Previous commit
Next Next commit
Go: Update dbscheme for aliases
  • Loading branch information
mbg committed Sep 1, 2024
commit f4b3dfc408289f1ced6d4a78f2f7598646e7b9a7
9 changes: 9 additions & 0 deletions 9 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
7 changes: 5 additions & 2 deletions 7 go/ql/lib/go.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ base_type(unique int ptr: @pointertype ref, int tp: @type ref);

underlying_type(unique int named: @namedtype ref, int tp: @type ref);

alias_rhs(unique int alias: @typealias ref, int tp: @type ref);

#keyset[parent, index]
component_types(int parent: @compositetype ref, int index: int ref, string name: string ref, int tp: @type ref);

Expand Down Expand Up @@ -501,7 +503,8 @@ case @type.kind of
| 36 = @recvchantype
| 37 = @sendrcvchantype
| 38 = @namedtype
| 39 = @typesetliteraltype;
| 39 = @typesetliteraltype
| 40 = @typealias;

@basictype = @booltype | @numerictype | @stringtype | @literaltype | @invalidtype | @unsafepointertype;

Expand All @@ -525,7 +528,7 @@ case @type.kind of
| @stringliteraltype | @nilliteraltype;

@compositetype = @typeparamtype | @containertype | @structtype | @pointertype | @interfacetype | @tupletype
| @signaturetype | @namedtype | @typesetliteraltype;
| @signaturetype | @namedtype | @typesetliteraltype | @typealias;

@containertype = @arraytype | @slicetype | @maptype | @chantype;

Expand Down
3 changes: 3 additions & 0 deletions 3 go/ql/lib/semmle/go/Types.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,9 @@ class NamedType extends @namedtype, CompositeType {
override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() }
}

class AliasType extends @typealias, CompositeType {
Type getRhs() { alias_rhs(this, result) }
}
/**
* A type that implements the builtin interface `error`.
*/
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.