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

Replace more IR Scala case classes with Java interfaces #12211

Merged
merged 23 commits into from
Feb 11, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
255ac9a
Do not use extractors for DefinitionArgument
Akirathan Jan 31, 2025
cd6d277
Do not use DefinitionArgument.apply
Akirathan Jan 31, 2025
cd178d1
Replace DefinitionArgument case class with Java interface
Akirathan Jan 31, 2025
6309510
Implement DefinitionArgument.showCode.
Akirathan Feb 4, 2025
0bf4a78
Fix compilation error in runtime-integration-tests
Akirathan Feb 5, 2025
2b14325
showCode method is not implemented in the generated superclass.
Akirathan Feb 6, 2025
9a7c2e3
Implement showCode method in tests.
Akirathan Feb 7, 2025
3e91fde
Fix match guard in SuggestionBuilder.
Akirathan Feb 7, 2025
b67720e
Merge branch 'develop' into wip/akirathan/more-java-ir
Akirathan Feb 10, 2025
596a6a0
Refactor match extractors of Application.Prefix to normal match
Akirathan Feb 10, 2025
c9935a0
Refactor apply to new operator
Akirathan Feb 10, 2025
365cb7c
Refactor match extractors of Application.Force to normal match
Akirathan Feb 10, 2025
61d225e
Refactor apply to new operator
Akirathan Feb 10, 2025
70fe733
IRNodeClassGenerator includes some necessary imports
Akirathan Feb 10, 2025
346bb9e
Literal trait is not sealed
Akirathan Feb 10, 2025
0223af5
Replace Application with Java
Akirathan Feb 10, 2025
d291479
Fix some copy methods and constructors
Akirathan Feb 10, 2025
91e1391
Explicitly call apply method in tests
Akirathan Feb 10, 2025
7ff0437
Fix some copy methods and constructors
Akirathan Feb 10, 2025
dd5c4c0
Generate copy builder
Akirathan Feb 10, 2025
a2002e4
setLocation uses copy builder
Akirathan Feb 10, 2025
d8f3bd2
Only add imports for types that are not in an unnamed package
Akirathan Feb 10, 2025
8b3d9a6
Fix null IdentifiedLocation in OperatorToFunctionTest
Akirathan Feb 10, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@ public Specified(Name name) {
this(name, Option.empty(), Option.empty(), false, null, new MetadataStorage());
}

@Override
public String showCode(int indent) {
Akirathan marked this conversation as resolved.
Show resolved Hide resolved
String withoutLazy;
if (defaultValue().isDefined() && ascribedType().isDefined()) {
var name = name().showCode(indent);
var typeExpr = ascribedType().get().showCode(indent);
var defaultExpr = defaultValue().get().showCode(indent);
withoutLazy = String.format("(%s : (%s) = (%s))", name, typeExpr, defaultExpr);
} else if (defaultValue().isDefined()) {
var name = name().showCode(indent);
var defaultExpr = defaultValue().get().showCode(indent);
withoutLazy = String.format("(%s = %s)", name, defaultExpr);
} else if (ascribedType().isDefined()) {
var name = name().showCode(indent);
var typeExpr = ascribedType().get().showCode(indent);
withoutLazy = String.format("((%s : %s))", name, typeExpr);
} else {
withoutLazy = name().showCode(indent);
}
if (suspended()) {
return "~" + withoutLazy;
} else {
return withoutLazy;
}
}

@Override
public DefinitionArgument withName(Name ir) {
return copy(
Expand Down
Loading