
    Argued and submitted January 23,
    reversed and remanded April 11, 1984
    OWENS, Respondent, v. HEISEL et al, Respondents, STATE OF OREGON, acting by and through the DEPARTMENT OF HUMAN RESOURCES, Appellant.
    
    (81-4109-NJ-3; CA A26855)
    679 P2d 331
    
      Margaret E. Rabin, Assistant Attorney General, Salem, argued the cause for appellant. With her on the brief were Dave Frohnmayer, Attorney General, and William F. Gary, Deputy Attorney General, Salem.
    Charles F. Adams, Portland, argued the cause for respondent Thomas E. Owens. With him on the brief was Randolph C. Foster, Portland.
    Penny Lee Austin, Medford, waived appearance for respondent Marion Owens.
    Manville M. Heisel, Medford, waived appearance for respondent Henry A. Owens.
    R. E. Dudrey, Portland, waived appearance for respondent U. S. National Bank of Oregon.
    No appearance by respondents William H. Owens and Mary Ann Martin.
    Before Richardson, Presiding Judge, Joseph, Chief Judge, and Newman, Judge.
    JOSEPH, C. J.
   JOSEPH, C. J.

This appeal is from a declaratory judgment entered on an order granting Thomas Owens’ (defendant) motion for partial summary judgment. He, William Owens and Mary Ann Martin are the remaindermen of a testamentary trust established by Henry Owens (settlor) for their father, Joseph Owens (beneficiary), whose personal representative is plaintiff. The settlor died on April 14,1979. The beneficiary died on September 4,1980, having been confined to the Oregon State Hospital for the last two years. The testamentary trust was never made operative by the settlor’s personal representative. The state filed a claim against the beneficiary’s estate under ORS 179.620 and was joined as a defendant when plaintiff brought this action seeking to compel establishment of the testamentary trust.

Defendant moved for summary judgment on the theory that the state is not entitled to recover its costs of caring for the beneficiary from the trust assets, ORS 179.620(3), and therefore the remaindermen are entitled to distribution of the assets under the terms of settlor’s will. The trial court ruled that the remaindermen “have a greater right” to the trust assets than the state, dismissed plaintiffs claim with prejudice and ordered distribution of the trust assets to the remaindermen. The state appeals. We reverse.

Settlor’s will provides in pertinent part:

“III

“I give and bequeath the sum of Fifty thousand Dollars ($50,000.00) to the UNITED STATES NATIONAL BANK OF OREGON, hereinafter designated as ‘my Trustee,’ IN TRUST, for the use and benefit of my friend, JOSEPH EDWIN OWENS, for the purposes and upon the terms and conditions hereinafter set forth.
“If Joseph Edwin Owens should predecease me, this bequest shall lapse and I give the Fifty thousand Dollars ($50,000.00) in equal shares to WILLIAM H. OWENS, THOMAS E. OWENS, and MARY ANN MARTIN, the children of Joseph Edwin Owens, with an equal share by right of representation to the then living descendants of each deceased child of Joseph Edwin Owens if any of the three children above named are deceased at the time of my death.
<<* * * * *
“VI
“As to the trust for Joseph Edwin Owens, I direct that my Trustee shall pay to or apply for the benefit of said Joseph Edwin Owens such portions of the net income and principal of his trust estate as my Trustee shall, in its discretion, deem necessary or advisable for the rest of his natural life.
“In the event of an illness or disability befalling Joseph Edwin Owens, my Trustee, taking into account other sources of income available to Joseph Edwin Owens, shall be authorized, in its absolute discretion, to pay to or for the benefit of Joseph Edwin Owens such portions of the net income and of the principal of his trust estate as my Trustee shall, in its discretion, deem necessary or advisable.
“Upon the death or Joseph Edwin Owens, the trust estate shall be settled and closed and the trust shall be distributed to William H. Owens, Thomas E. Owens and Mary Ann Martin, in equal shares, with an equal share by right of representation to the then living descendants of any of the three persons last named if he or she be deceased.”

There is no question that settlor’s will created a testamentary trust. See U.S. Nat. Bank v. Krautwashl et al, 221 Or 609, 612, 351 P2d 947 (1960). ORS 114.215 provides: “Upon the death of a decedent, title to his property vests * * * (b) in the persons to whom it is devised by his will. * * *” It follows that, on the death of the settlor, the legal title to the trust property vested in the trustee and the equitable title vested in the beneficiary. That much at least is clear, and we do not understand the parties to disagree about whether a valid testamentary trust was created by settlor’s will.

At this point, however, both clarity and agreement end. Defendant argues that, in view of the beneficiary’s death, establishment of the trust would defeat the settlor’s intent because, as he reads the will, the trust was to be used only when no other source of funds was available to secure needed medical care for the beneficiary. Defendant reasons that, because the beneficiary received medical care without expenditures from the trust and will be requiring no further medical care, establishment of the trust would be a “useless act.” He concludes that the trust copies should be distributed to the remaindermen pursuant to paragraph VI of the will.

It is elementary that “[t]he intention of a testator as expressed in his will controls the legal effect of his dispositions.” ORS 112.227. Here, the settlor’s intent has already been frustrated — he intended that a trust be established and that the trustee “pay to or apply for the benefit of said Joseph Edwin Owens such portions of the net income and principal of his trust estate- as my trustee shall, in its discretion, deem necessary or advisable for the rest of his natural life.” We do not agree with defendant that the will established a trust to be used only when no other source of funds was available to secure needed medical care, nor do we agree that, because the beneficiary has died, establishment of the trust would defeat the settlor’s intent.

It may be true, as the trial court ruled, that the remaindermen have a greater right to the trust assets than does the state. In view of ORS 179.620(3), supra n 2, the state concedes that it cannot compel payment for care and maintenance from the trust assets. In this sense, the state has no right to the trust assets at all. Nevertheless, the state is entitled to present its claim to the trustee for consideration in accordance with the terms of the trust. The beneficiary had a prior and greater right in the trust assets than the remaindermen; his equitable title thereto vested on the settlor’s death, and it is not a “useless act” for the law to recognize that right during the period that the beneficiary survived the settlor. The remaindermen are not entitled to the trust assets until the purpose of the trust has been accomplished. That purpose remains to be accomplished, and the trial court erred in granting defendant’s motion for summary judgment and ordering distribution of the trust assets.

Reversed and remanded. 
      
      A cross-claim to recover a debt allegedly owed by defendant William H. Owens to the estate of Henry A. Owens remains pending. The trial court entered final judgment on plaintiffs claim pursuant to ORCP 67B.
     
      
       ORS 179.620 provides that:
      “(1) If a person at a state institution is possessed of an income sufficient to pay the expenses of care and maintenance, the person at the state institution is required to reimburse the State of Oregon for the cost of the care and maintenance during the person’s stay at the state institution.
      “(2) A person at a state institution is liable for the payment of the monthly charge fixed as provided in ORS 179.701 for care and maintenance according to the person’s ability to pay determined as provided in ORS 179.610 to 179.770.
      “(3) Upon the death of any person who is or has been a person at a state institution, the estate of the person shall be liable for the cost of care and maintenance of the person as computed under ORS 179.701. The liability of the person’s estate is limited to the cost of care and maintenance incurred on or after July 24,1979. For purposes of this section and ORS 179.740, the person’s estate shall not include assets placed in trust for the person by other persons.”
     
      
       The trial court ordered that defendant William H. Owens’ share of the remainder not be distributed until resolution of the cross-claim against him.
     
      
       There is nothing before us to permit any conclusion whether the claim, if presented, would or would not be allowed.
     